From a914a0414232e30943f7b2ffd997d74bd018a7b1 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 18 Feb 2016 20:12:38 -0500 Subject: pg_dump: Fix inconsistent sscanf() conversions It was using %u to read a string that was earlier produced by snprintf with %d into a signed integer variable. This seems to work in practice but is incorrect. found by cppcheck --- src/bin/pg_dump/pg_backup_custom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bin/pg_dump/pg_backup_custom.c') diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c index be6dbca0566..66329dc90c2 100644 --- a/src/bin/pg_dump/pg_backup_custom.c +++ b/src/bin/pg_dump/pg_backup_custom.c @@ -871,7 +871,7 @@ _MasterEndParallelItem(ArchiveHandle *AH, TocEntry *te, const char *str, T_Actio /* no parallel dump in the custom archive */ Assert(act == ACT_RESTORE); - sscanf(str, "%u %u %u%n", &dumpId, &status, &n_errors, &nBytes); + sscanf(str, "%d %d %d%n", &dumpId, &status, &n_errors, &nBytes); Assert(nBytes == strlen(str)); Assert(dumpId == te->dumpId); -- cgit v1.2.3