pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_resetwal: Improve numeric command-line argument parsing
Date: Fri, 20 Aug 2021 09:05:59 +0000
Message-ID: <E1mH0TP-0002TM-9u@gemulon.postgresql.org> (raw)

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

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(-)



Message-ID: <E1mH0TP-0002TM-9u@gemulon.postgresql.org>
Permalink:  ../E1mH0TP-0002TM-9u@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mH0TP-0002TM-9u@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org
  Subject: Re: pgsql: pg_resetwal: Improve numeric command-line argument parsing
  In-Reply-To: <E1mH0TP-0002TM-9u@gemulon.postgresql.org>
  References: <E1mH0TP-0002TM-9u@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox