pgsql: pg_resetwal: Improve numeric command-line argument parsing

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_resetwal: Improve numeric command-line argument parsing
Date: 2021-08-20 09:05:59
Message-ID: E1mH0TP-0002TM-9u@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 <mark(dot)dilger(at)enterprisedb(dot)com>
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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2021-08-20 09:44:14 pgsql: psql: Add test for query canceling
Previous Message Tom Lane 2021-08-19 16:12:59 pgsql: Avoid trying to lock OLD/NEW in a rule with FOR UPDATE.