From 08c74654d4bd67e6925276958d2d40b61af5feb2 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Thu, 30 Jul 2026 08:39:48 +0000 Subject: [PATCH v1 5/5] Fix invalid endptr comparison in pg_verifybackup.c strtoul() will never set endptr to NULL. It's an invalid check. We should be checking if suffix points to relpath instead. Signed-off-by: Tristan Partin --- src/bin/pg_verifybackup/pg_verifybackup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/pg_verifybackup/pg_verifybackup.c b/src/bin/pg_verifybackup/pg_verifybackup.c index 05385a91e88..796eeb6ec04 100644 --- a/src/bin/pg_verifybackup/pg_verifybackup.c +++ b/src/bin/pg_verifybackup/pg_verifybackup.c @@ -961,7 +961,7 @@ precheck_tar_backup_file(verifier_context *context, char *relpath, * Report an error if we didn't consume at least one character, if the * result is 0, or if the value is too large to be a valid OID. */ - if (suffix == NULL || num <= 0 || num > OID_MAX) + if (suffix == relpath || num <= 0 || num > OID_MAX) { report_backup_error(context, "file \"%s\" is not expected in a tar format backup", -- Tristan Partin https://tristan.partin.io