forked from aniani/vim
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)
This commit is contained in:
@@ -1346,11 +1346,11 @@ handle_pushline(int cols, const VTermScreenCell *cells, void *user)
|
|||||||
if (cells[i].chars[0] != 0)
|
if (cells[i].chars[0] != 0)
|
||||||
len = i + 1;
|
len = i + 1;
|
||||||
|
|
||||||
|
ga_init2(&ga, 1, 100);
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
p = (cellattr_T *)alloc((int)sizeof(cellattr_T) * len);
|
p = (cellattr_T *)alloc((int)sizeof(cellattr_T) * len);
|
||||||
if (p != NULL)
|
if (p != NULL)
|
||||||
{
|
{
|
||||||
ga_init2(&ga, 1, 100);
|
|
||||||
for (col = 0; col < len; col += cells[col].width)
|
for (col = 0; col < len; col += cells[col].width)
|
||||||
{
|
{
|
||||||
if (ga_grow(&ga, MB_MAXBYTES) == FAIL)
|
if (ga_grow(&ga, MB_MAXBYTES) == FAIL)
|
||||||
|
@@ -769,6 +769,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
891,
|
||||||
/**/
|
/**/
|
||||||
890,
|
890,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user