Permalink
Browse files

patch 8.0.0891: uninitialized memory use with empty line in terminal

Problem:    Uninitialized memory use with empty line in terminal.
Solution:   Initialize growarray earlier. (Yasuhiro Matsumoto, closes #1949)
  • Loading branch information...
brammool committed Aug 7, 2017
1 parent 75373f3 commit 7fadbf83256bb823b994a52758127594dd82ab39
Showing with 3 additions and 1 deletion.
  1. +1 −1 src/terminal.c
  2. +2 −0 src/version.c
View
@@ -1346,11 +1346,11 @@ handle_pushline(int cols, const VTermScreenCell *cells, void *user)
if (cells[i].chars[0] != 0)
len = i + 1;
ga_init2(&ga, 1, 100);
if (len > 0)
p = (cellattr_T *)alloc((int)sizeof(cellattr_T) * len);
if (p != NULL)
{
ga_init2(&ga, 1, 100);
for (col = 0; col < len; col += cells[col].width)
{
if (ga_grow(&ga, MB_MAXBYTES) == FAIL)
View
@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
891,
/**/
890,
/**/

0 comments on commit 7fadbf8

Please sign in to comment.