diff options
Diffstat (limited to 'src/backend/replication')
-rw-r--r-- | src/backend/replication/basebackup.c | 6 | ||||
-rw-r--r-- | src/backend/replication/logical/reorderbuffer.c | 2 | ||||
-rw-r--r-- | src/backend/replication/logical/snapbuild.c | 4 | ||||
-rw-r--r-- | src/backend/replication/slot.c | 6 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c index bcb5eff620b..e4074d30351 100644 --- a/src/backend/replication/basebackup.c +++ b/src/backend/replication/basebackup.c @@ -167,7 +167,7 @@ perform_base_backup(basebackup_options *opt, DIR *tblspcdir) /* Collect information about all tablespaces */ while ((de = ReadDir(tblspcdir, "pg_tblspc")) != NULL) { - char fullpath[MAXPGPATH]; + char fullpath[MAXPGPATH + 10]; char linkpath[MAXPGPATH]; char *relpath = NULL; int rllen; @@ -930,7 +930,7 @@ sendDir(char *path, int basepathlen, bool sizeonly, List *tablespaces) { DIR *dir; struct dirent *de; - char pathbuf[MAXPGPATH]; + char pathbuf[MAXPGPATH * 2]; struct stat statbuf; int64 size = 0; @@ -978,7 +978,7 @@ sendDir(char *path, int basepathlen, bool sizeonly, List *tablespaces) "and should not be used. " "Try taking another online backup."))); - snprintf(pathbuf, MAXPGPATH, "%s/%s", path, de->d_name); + snprintf(pathbuf, sizeof(pathbuf), "%s/%s", path, de->d_name); /* Skip postmaster.pid and postmaster.opts in the data directory */ if (strcmp(pathbuf, "./postmaster.pid") == 0 || diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c index e5c3625abf5..56490689701 100644 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -2443,7 +2443,7 @@ StartupReorderBuffer(void) while ((logical_de = ReadDir(logical_dir, "pg_replslot")) != NULL) { struct stat statbuf; - char path[MAXPGPATH]; + char path[MAXPGPATH * 2 + 12]; if (strcmp(logical_de->d_name, ".") == 0 || strcmp(logical_de->d_name, "..") == 0) diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c index b08afe6694a..9359fc2386d 100644 --- a/src/backend/replication/logical/snapbuild.c +++ b/src/backend/replication/logical/snapbuild.c @@ -1814,7 +1814,7 @@ CheckPointSnapBuild(void) XLogRecPtr redo; DIR *snap_dir; struct dirent *snap_de; - char path[MAXPGPATH]; + char path[MAXPGPATH + 21]; /* * We start of with a minimum of the last redo pointer. No new replication @@ -1841,7 +1841,7 @@ CheckPointSnapBuild(void) strcmp(snap_de->d_name, "..") == 0) continue; - snprintf(path, MAXPGPATH, "pg_logical/snapshots/%s", snap_de->d_name); + snprintf(path, sizeof(path), "pg_logical/snapshots/%s", snap_de->d_name); if (lstat(path, &statbuf) == 0 && !S_ISREG(statbuf.st_mode)) { diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c index f108979e6f1..7f04b22d2d6 100644 --- a/src/backend/replication/slot.c +++ b/src/backend/replication/slot.c @@ -860,13 +860,13 @@ StartupReplicationSlots(void) while ((replication_de = ReadDir(replication_dir, "pg_replslot")) != NULL) { struct stat statbuf; - char path[MAXPGPATH]; + char path[MAXPGPATH + 12]; if (strcmp(replication_de->d_name, ".") == 0 || strcmp(replication_de->d_name, "..") == 0) continue; - snprintf(path, MAXPGPATH, "pg_replslot/%s", replication_de->d_name); + snprintf(path, sizeof(path), "pg_replslot/%s", replication_de->d_name); /* we're only creating directories here, skip if it's not our's */ if (lstat(path, &statbuf) == 0 && !S_ISDIR(statbuf.st_mode)) @@ -1098,7 +1098,7 @@ RestoreSlotFromDisk(const char *name) { ReplicationSlotOnDisk cp; int i; - char path[MAXPGPATH]; + char path[MAXPGPATH + 22]; int fd; bool restored = false; int readBytes; |