aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_basebackup/streamutil.c2
-rw-r--r--src/bin/pg_dump/pg_backup_directory.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/pg_basebackup/streamutil.c b/src/bin/pg_basebackup/streamutil.c
index 9309a8de955..1510b7cc088 100644
--- a/src/bin/pg_basebackup/streamutil.c
+++ b/src/bin/pg_basebackup/streamutil.c
@@ -316,7 +316,7 @@ RetrieveWalSegSize(PGconn *conn)
}
/* fetch xlog value and unit from the result */
- if (sscanf(PQgetvalue(res, 0, 0), "%d%s", &xlog_val, xlog_unit) != 2)
+ if (sscanf(PQgetvalue(res, 0, 0), "%d%2s", &xlog_val, xlog_unit) != 2)
{
fprintf(stderr, _("%s: WAL segment size could not be parsed\n"),
progname);
diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c
index fe1f8e1e33f..2c75caec488 100644
--- a/src/bin/pg_dump/pg_backup_directory.c
+++ b/src/bin/pg_dump/pg_backup_directory.c
@@ -458,11 +458,11 @@ _LoadBlobs(ArchiveHandle *AH)
/* Read the blobs TOC file line-by-line, and process each blob */
while ((cfgets(ctx->blobsTocFH, line, MAXPGPATH)) != NULL)
{
- char fname[MAXPGPATH];
+ char fname[MAXPGPATH + 1];
char path[MAXPGPATH];
/* Can't overflow because line and fname are the same length. */
- if (sscanf(line, "%u %s\n", &oid, fname) != 2)
+ if (sscanf(line, "%u %" CppAsString2(MAXPGPATH) "s\n", &oid, fname) != 2)
exit_horribly(modulename, "invalid line in large object TOC file \"%s\": \"%s\"\n",
fname, line);