Skip to content

Commit 9b4ebc6

Browse files
committed
patch 7.4.1813
Problem: Memory access error when running test_quickfix. Solution: Allocate one more byte. (Yegappan Lakshmanan)
1 parent 187147a commit 9b4ebc6

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/quickfix.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -545,12 +545,12 @@ qf_init_ext(
545545
linelen = len > LINE_MAXLEN ? LINE_MAXLEN - 1 : len;
546546
if (growbuf == NULL)
547547
{
548-
growbuf = alloc(linelen);
548+
growbuf = alloc(linelen + 1);
549549
growbufsiz = linelen;
550550
}
551551
else if (linelen > growbufsiz)
552552
{
553-
growbuf = vim_realloc(growbuf, linelen);
553+
growbuf = vim_realloc(growbuf, linelen + 1);
554554
if (growbuf == NULL)
555555
goto qf_init_end;
556556
growbufsiz = linelen;
@@ -589,13 +589,13 @@ qf_init_ext(
589589
linelen = LINE_MAXLEN - 1;
590590
if (growbuf == NULL)
591591
{
592-
growbuf = alloc(linelen);
592+
growbuf = alloc(linelen + 1);
593593
growbufsiz = linelen;
594594
}
595595
else if (linelen > growbufsiz)
596596
{
597597
if ((growbuf = vim_realloc(growbuf,
598-
linelen)) == NULL)
598+
linelen + 1)) == NULL)
599599
goto qf_init_end;
600600
growbufsiz = linelen;
601601
}
@@ -623,14 +623,14 @@ qf_init_ext(
623623
{
624624
if (growbuf == NULL)
625625
{
626-
growbuf = alloc(linelen);
626+
growbuf = alloc(linelen + 1);
627627
growbufsiz = linelen;
628628
}
629629
else if (linelen > growbufsiz)
630630
{
631631
if (linelen > LINE_MAXLEN)
632632
linelen = LINE_MAXLEN - 1;
633-
if ((growbuf = vim_realloc(growbuf, linelen)) == NULL)
633+
if ((growbuf = vim_realloc(growbuf, linelen + 1)) == NULL)
634634
goto qf_init_end;
635635
growbufsiz = linelen;
636636
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,8 @@ static char *(features[]) =
753753

754754
static int included_patches[] =
755755
{ /* Add new patch number below this line */
756+
/**/
757+
1813,
756758
/**/
757759
1812,
758760
/**/

0 commit comments

Comments
 (0)