pgsql: pg_verifybackup: Improve some error handling around strtoul() ca
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: /messages/by-id/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(-)