diff options
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/initdb/findtimezone.c | 4 | ||||
-rw-r--r-- | src/bin/pg_basebackup/pg_basebackup.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/bin/initdb/findtimezone.c b/src/bin/initdb/findtimezone.c index d3a8c17ee22..24e94326a92 100644 --- a/src/bin/initdb/findtimezone.c +++ b/src/bin/initdb/findtimezone.c @@ -68,7 +68,7 @@ pg_open_tzfile(const char *name, char *canonname) if (canonname) strlcpy(canonname, name, TZ_STRLEN_MAX + 1); - strcpy(fullname, pg_TZDIR()); + strlcpy(fullname, pg_TZDIR(), sizeof(fullname)); if (strlen(fullname) + 1 + strlen(name) >= MAXPGPATH) return -1; /* not gonna fit */ strcat(fullname, "/"); @@ -375,7 +375,7 @@ identify_system_timezone(void) } /* Search for the best-matching timezone file */ - strcpy(tmptzdir, pg_TZDIR()); + strlcpy(tmptzdir, pg_TZDIR(), sizeof(tmptzdir)); bestscore = -1; resultbuf[0] = '\0'; scan_available_timezones(tmptzdir, tmptzdir + strlen(tmptzdir) + 1, diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 07afef79656..b1bcf698eb6 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -903,9 +903,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 @@ -1432,7 +1432,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, @@ -1544,7 +1544,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); |