# HG changeset patch # User Christian Brabandt # Date 1502136904 -7200 # Node ID a7457aed7e80f1fea98a0a7b835fe5d653581344 # Parent 7aa74e6107044157a53cf3208e3150133edd7e7e patch 8.0.0891: uninitialized memory use with empty line in terminal commit https://github.com/vim/vim/commit/7fadbf83256bb823b994a52758127594dd82ab39 Author: Bram Moolenaar Date: Mon Aug 7 22:08:05 2017 +0200 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 https://github.com/vim/vim/issues/1949) diff --git a/src/terminal.c b/src/terminal.c --- a/src/terminal.c +++ b/src/terminal.c @@ -1346,11 +1346,11 @@ handle_pushline(int cols, const VTermScr 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) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -770,6 +770,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 891, +/**/ 890, /**/ 889,