diff options
Diffstat (limited to 'src/bin/pg_basebackup/pg_basebackup.c')
-rw-r--r-- | src/bin/pg_basebackup/pg_basebackup.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index b5682d6f511..3d155e8907c 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -921,9 +921,9 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum) FILE *file = NULL; if (basetablespace) - strcpy(current_path, basedir); + strlcpy(current_path, basedir, sizeof(current_path)); else - strcpy(current_path, PQgetvalue(res, rownum, 1)); + strlcpy(current_path, PQgetvalue(res, rownum, 1), sizeof(current_path)); /* * Get the COPY data @@ -1454,7 +1454,7 @@ BaseBackup(void) disconnect_and_exit(1); } - strcpy(xlogstart, PQgetvalue(res, 0, 0)); + strlcpy(xlogstart, PQgetvalue(res, 0, 0), sizeof(xlogstart)); /* * 9.3 and later sends the TLI of the starting point. With older servers, @@ -1565,7 +1565,7 @@ BaseBackup(void) progname); disconnect_and_exit(1); } - strcpy(xlogend, PQgetvalue(res, 0, 0)); + strlcpy(xlogend, PQgetvalue(res, 0, 0), sizeof(xlogend)); if (verbose && includewal) fprintf(stderr, "transaction log end point: %s\n", xlogend); PQclear(res); |