Hi Chao,

I'm not sure if the change is needed.

strtoint() job has always been to detect overflow through errno. All the
core callers in that style (datetime.c, read.c, tsearchcmds.c, jsonfuncs.c,
psql, option_utils.c) check errno == ERANGE and never
look at the return value after an overflow. For them v1 changes nothing.
On Windows, where long is 32 bits, strtol() already returns
INT_MAX/INT_MIN, so nothing changes there either.

The only callers that see a difference are the ones that ignore errno:
pgcrypto's px_crypt_shacrypt() and a few ecpg pgtypeslib/dt_common.c paths.
For those, the real bug is that they don't check errno.


Regards,
Surya Poondla

Reply via email to