pgsql: pg_resetwal: Improve numeric command-line argument parsing - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: pg_resetwal: Improve numeric command-line argument parsing
Date
Msg-id [email protected]
Whole thread Raw
List pgsql-committers
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 <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/6a10a211-872b-3c4c-106b-909ae5fefa61%40enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9a6345ed741783e8770ef160e822d2257873adef

Modified Files
--------------
src/bin/pg_resetwal/pg_resetwal.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Avoid trying to lock OLD/NEW in a rule with FOR UPDATE.
Next
From: Peter Eisentraut
Date:
Subject: pgsql: psql: Add test for query canceling