]> git.ipfire.org Git - thirdparty/postgresql.git/commit
pg_resetwal: Improve numeric command-line argument parsing
authorPeter Eisentraut <peter@eisentraut.org>
Fri, 20 Aug 2021 05:54:23 +0000 (07:54 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Fri, 20 Aug 2021 08:51:59 +0000 (10:51 +0200)
commit9a6345ed741783e8770ef160e822d2257873adef
treec35ca5988106814066b765a5cab4732651f5f791
parentf1899f251df421a4715ce5e231855eb6914bf77d
pg_resetwal: Improve numeric command-line argument parsing

Check errno after strtoul()/strtol() to handle out of range errors
better.  For out of range, strtoul() returns ULONG_MAX, and the
previous code would proceed with that result.

Reported-by: Mark Dilger <mark.dilger@enterprisedb.com>
Discussion: https://www.postgresql.org/message-id/flat/6a10a211-872b-3c4c-106b-909ae5fefa61%40enterprisedb.com
src/bin/pg_resetwal/pg_resetwal.c