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-000227-7K@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
------
REL_11_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/c7181a32c57d97b7a899776dabae6892e2b98b93
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(-)
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-000227-7K@gemulon.postgresql.org>
References: <E1m9ZLm-000227-7K@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