fix stack buffer overflow

This commit is contained in:
Grigory Smolkin
2019-12-29 14:23:28 +03:00
parent b0efb76003
commit e1dfb614cf
2 changed files with 5 additions and 7 deletions
+2 -2
View File
@@ -697,8 +697,8 @@ catalog_get_timelines(InstanceConfig *instance)
char arclog_path[MAXPGPATH];
/* for fancy reporting */
char begin_segno_str[XLOG_FNAME_LEN];
char end_segno_str[XLOG_FNAME_LEN];
char begin_segno_str[MAXFNAMELEN];
char end_segno_str[MAXFNAMELEN];
/* read all xlog files that belong to this archive */
sprintf(arclog_path, "%s/%s/%s", backup_path, "wal", instance->name);
+3 -5
View File
@@ -806,9 +806,8 @@ delete_walfiles_in_tli(XLogRecPtr keep_lsn, timelineInfo *tlinfo,
{
XLogSegNo FirstToDeleteSegNo;
XLogSegNo OldestToKeepSegNo = 0;
char first_to_del_str[XLOG_FNAME_LEN];
char oldest_to_keep_str[XLOG_FNAME_LEN];
int rc;
char first_to_del_str[MAXFNAMELEN];
char oldest_to_keep_str[MAXFNAMELEN];
int i;
size_t wal_size_logical = 0;
size_t wal_size_actual = 0;
@@ -933,8 +932,7 @@ delete_walfiles_in_tli(XLogRecPtr keep_lsn, timelineInfo *tlinfo,
}
/* unlink segment */
rc = fio_unlink(wal_file->file.path, FIO_BACKUP_HOST);
if (rc < 0)
if (fio_unlink(wal_file->file.path, FIO_BACKUP_HOST) < 0)
{
/* Missing file is not considered as error condition */
if (errno != ENOENT)