Fix overflow in parsing of positional parameter Replace atol with pg_strtoint32_safe in the backend parser and with strtoint in ECPG to reject overflows when parsing the number of a positional parameter. With atol from glibc, parameters $2147483648 and $4294967297 turn into $-2147483648 and $1, respectively.
Author: Erik Wienhold <[email protected]> Reviewed-by: Michael Paquier <[email protected]> Reviewed-by: Peter Eisentraut <[email protected]> Reviewed-by: Alexander Lakhin <[email protected]> Discussion: https://www.postgresql.org/message-id/flat/[email protected] Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/d35cd061998434747c0d1c0f6f2aa1f736f0edb4 Modified Files -------------- src/backend/parser/scan.l | 8 +++++++- src/interfaces/ecpg/preproc/pgc.l | 8 +++++++- src/test/regress/expected/numerology.out | 4 ++++ src/test/regress/sql/numerology.sql | 1 + 4 files changed, 19 insertions(+), 2 deletions(-)
