From 48b5d0f1ba1ad75411f6510ed79d322116ba6809 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 12 Dec 2016 15:04:52 -0500 Subject: vim-patch:7.4.1813 Problem: Memory access error when running test_quickfix. Solution: Allocate one more byte. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/9b4ebc692d77ca8ef90d72517347f74c2474dd3d --- src/nvim/quickfix.c | 12 ++++++------ src/nvim/version.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 3c59fcef03..b4f8750c4c 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -492,9 +492,9 @@ qf_init_ext ( // not a NL character. linelen = len > LINE_MAXLEN ? LINE_MAXLEN - 1 : len; if (growbuf == NULL) { - growbuf = xmalloc(linelen); + growbuf = xmalloc(linelen + 1); } else if (linelen > growbufsiz) { - growbuf = xrealloc(growbuf, linelen); + growbuf = xrealloc(growbuf, linelen + 1); } growbufsiz = linelen; linebuf = growbuf; @@ -525,10 +525,10 @@ qf_init_ext ( linelen = LINE_MAXLEN - 1; } if (growbuf == NULL) { - growbuf = xmalloc(linelen); + growbuf = xmalloc(linelen + 1); growbufsiz = linelen; } else if (linelen > growbufsiz) { - growbuf = xrealloc(growbuf, linelen); + growbuf = xrealloc(growbuf, linelen + 1); growbufsiz = linelen; } linebuf = growbuf; @@ -549,13 +549,13 @@ qf_init_ext ( linelen = STRLEN(p_buf); if (linelen > IOSIZE - 2) { if (growbuf == NULL) { - growbuf = xmalloc(linelen); + growbuf = xmalloc(linelen + 1); growbufsiz = linelen; } else if (linelen > growbufsiz) { if (linelen > LINE_MAXLEN) { linelen = LINE_MAXLEN - 1; } - growbuf = xrealloc(growbuf, linelen); + growbuf = xrealloc(growbuf, linelen + 1); growbufsiz = linelen; } linebuf = growbuf; diff --git a/src/nvim/version.c b/src/nvim/version.c index 897daf359c..5edced3f0d 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -626,7 +626,7 @@ static int included_patches[] = { 1816, // 1815, // 1814 NA - // 1813, + 1813, // 1812, // 1811 NA // 1810 NA -- cgit