Skip to content

Commit c2f52dc

Browse files
committed
Fix for [Issue #155]. Allocate destination buffer size correctly
1 parent f431452 commit c2f52dc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/show.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ typedef struct ShowArchiveRow
4343
char tli[20];
4444
char parent_tli[20];
4545
char switchpoint[20];
46-
char min_segno[XLOG_FNAME_LEN+1];
47-
char max_segno[XLOG_FNAME_LEN+1];
46+
char min_segno[MAXFNAMELEN];
47+
char max_segno[MAXFNAMELEN];
4848
char n_segments[20];
4949
char size[20];
5050
char zratio[20];
@@ -748,7 +748,7 @@ static void
748748
show_archive_plain(const char *instance_name, uint32 xlog_seg_size,
749749
parray *tli_list, bool show_name)
750750
{
751-
char segno_tmp[XLOG_FNAME_LEN+1];
751+
char segno_tmp[MAXFNAMELEN];
752752
parray *actual_tli_list = parray_new();
753753
#define SHOW_ARCHIVE_FIELDS_COUNT 10
754754
int i;
@@ -939,7 +939,7 @@ show_archive_json(const char *instance_name, uint32 xlog_seg_size,
939939
int i,j;
940940
PQExpBuffer buf = &show_buf;
941941
parray *actual_tli_list = parray_new();
942-
char segno_tmp[XLOG_FNAME_LEN+1];
942+
char segno_tmp[MAXFNAMELEN];
943943

944944
if (!first_instance)
945945
appendPQExpBufferChar(buf, ',');
@@ -968,7 +968,7 @@ show_archive_json(const char *instance_name, uint32 xlog_seg_size,
968968
for (i = parray_num(actual_tli_list) - 1; i >= 0; i--)
969969
{
970970
timelineInfo *tlinfo = (timelineInfo *) parray_get(actual_tli_list, i);
971-
char tmp_buf[XLOG_FNAME_LEN+1];
971+
char tmp_buf[MAXFNAMELEN];
972972
float zratio = 0;
973973

974974
if (i != (parray_num(actual_tli_list) - 1))

0 commit comments

Comments
 (0)