pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John Naylor <john.naylor@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix range check in ECPG numeric to int conversion
Date: Fri, 30 Jul 2021 20:43:22 +0000
Message-ID: <E1m9ZLm-00022D-8E@gemulon.postgresql.org> (raw)

Fix range check in ECPG numeric to int conversion

The previous coding guarded against -INT_MAX instead of INT_MIN,
leading to -2147483648 being rejected as out of range.

Per bug #17128 from Kevin Sweet

Discussion: https://www.postgresql.org/message-id/flat/17128-55a8a879727a3e3a%40postgresql.org
Reviewed-by: Tom Lane
Backpatch to all supported branches

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/cfcb0ceabde11dc6bf57185f72a2b14132631dfd

Modified Files
--------------
doc/src/sgml/ecpg.sgml                              |  2 +-
src/interfaces/ecpg/pgtypeslib/numeric.c            |  7 ++++++-
.../ecpg/test/expected/pgtypeslib-num_test.c        | 21 ++++++++++++++++-----
.../ecpg/test/expected/pgtypeslib-num_test.stderr   |  2 +-
.../ecpg/test/expected/pgtypeslib-num_test.stdout   |  2 ++
src/interfaces/ecpg/test/pgtypeslib/num_test.pgc    | 13 ++++++++++++-
6 files changed, 38 insertions(+), 9 deletions(-)



view thread (8+ messages)  latest in thread

Message-ID: <E1m9ZLm-00022D-8E@gemulon.postgresql.org>
Permalink:  ../E1m9ZLm-00022D-8E@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1m9ZLm-00022D-8E@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: john.naylor@postgresql.org
  Subject: Re: pgsql: Fix range check in ECPG numeric to int conversion
  In-Reply-To: <E1m9ZLm-00022D-8E@gemulon.postgresql.org>
  References: <E1m9ZLm-00022D-8E@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox