diff --git a/src/backup.c b/src/backup.c index 83b311c4..57c4be51 100644 --- a/src/backup.c +++ b/src/backup.c @@ -547,7 +547,8 @@ do_backup_instance(void) /* notify start of backup to PostgreSQL server */ time2iso(label, lengthof(label), current.start_time); - strncat(label, " with pg_probackup", lengthof(label)); + strncat(label, " with pg_probackup", lengthof(label) - + strlen(" with pg_probackup")); pg_start_backup(label, smooth_checkpoint, ¤t); pgBackupGetPath(¤t, database_path, lengthof(database_path), diff --git a/src/parsexlog.c b/src/parsexlog.c index be856bff..a0079b42 100644 --- a/src/parsexlog.c +++ b/src/parsexlog.c @@ -333,7 +333,7 @@ validate_wal(pgBackup *backup, */ if (backup->stream) { - sprintf(backup_xlog_path, "/%s/%s/%s/%s", + snprintf(backup_xlog_path, sizeof(backup_xlog_path), "/%s/%s/%s/%s", backup_instance_path, backup_id, DATABASE_DIR, PG_XLOG_DIR); validate_backup_wal_from_start_to_stop(backup, backup_xlog_path, tli);