aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/replication/basebackup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c
index eb6eb7206da..e4c45c50256 100644
--- a/src/backend/replication/basebackup.c
+++ b/src/backend/replication/basebackup.c
@@ -1056,7 +1056,8 @@ sendDir(const char *path, int basepathlen, bool sizeonly, List *tablespaces,
* If any other type of fork, check if there is an init fork
* with the same OID. If so, the file can be excluded.
*/
- strncpy(relOid, de->d_name, relOidChars);
+ memcpy(relOid, de->d_name, relOidChars);
+ relOid[relOidChars] = '\0';
snprintf(initForkFile, sizeof(initForkFile), "%s/%s_init",
path, relOid);