vim-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.

3b31851356

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2022-10-28 13:27:38 +08:00
parent bfdf10d870
commit 3afcc48a05

View File

@@ -1841,6 +1841,7 @@ dictitem_T *tv_dict_item_alloc_len(const char *const key, const size_t key_len)
di->di_key[key_len] = NUL;
di->di_flags = DI_FLAGS_ALLOC;
di->di_tv.v_lock = VAR_UNLOCKED;
di->di_tv.v_type = VAR_UNKNOWN;
return di;
}