agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_verifybackup: Improve some error handling around strtoul() ca
Date: Sat, 01 Aug 2026 10:45:21 +0000
Message-ID: <E1wq7DV-00000001Dvg-0Six@gemulon.postgresql.org> (raw)
pg_verifybackup: Improve some error handling around strtoul() calls
Three code paths checking the size, timeline ID and system identifier
stored in a manifest now check for an empty value. Values are always
expected in these parts of a backup banifest. A couple of tests are
added to validate this behavior
Additionally, precheck_tar_backup_file() checked that "endptr" is NULL.
Based on the C standard, strtoul() never sets an "endptr" to NULL when
given a value (that is the case here), returning a pointer to the
original value if there is nothing to convert. The pre-tar validation
code is adjusted to do so.
Author: Tristan Partin <tristan@partin.io>
Discussion: https://postgr.es/m/DKBS2Z9CGARC.2T07O6TJYSE8B@partin.io
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/355814931141537e51418a276c74e91283da9631
Modified Files
--------------
src/bin/pg_verifybackup/pg_verifybackup.c | 2 +-
src/bin/pg_verifybackup/t/005_bad_manifest.pl | 16 ++++++++++++++++
src/common/parse_manifest.c | 6 +++---
3 files changed, 20 insertions(+), 4 deletions(-)
Message-ID: <E1wq7DV-00000001Dvg-0Six@gemulon.postgresql.org>
Permalink: ../E1wq7DV-00000001Dvg-0Six@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1wq7DV-00000001Dvg-0Six@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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: pg_verifybackup: Improve some error handling around strtoul() ca
In-Reply-To: <E1wq7DV-00000001Dvg-0Six@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox