patch 8.2.3407: using uninitialized memory with "let g:['bar'] = 2"

Problem:    Using uninitialized memory with "let g:['bar'] = 2".
Solution:   Initialize v_type of a new dict item.
This commit is contained in:
Bram Moolenaar
2021-09-06 19:19:45 +02:00
parent 3ae5fc9a6a
commit 3b31851356
2 changed files with 3 additions and 0 deletions

View File

@ -229,6 +229,7 @@ dictitem_alloc(char_u *key)
STRCPY(di->di_key, key);
di->di_flags = DI_FLAGS_ALLOC;
di->di_tv.v_lock = 0;
di->di_tv.v_type = VAR_UNKNOWN;
}
return di;
}

View File

@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3407,
/**/
3406,
/**/