0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.0735: Vim9: using unitialized memory

Problem:    Vim9: using unitialized memory.
Solution:   Clear the arg_lvar field.
This commit is contained in:
Bram Moolenaar
2020-05-10 23:20:06 +02:00
parent 04816717df
commit bc38f25c02
2 changed files with 12 additions and 8 deletions

View File

@@ -746,6 +746,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 */
/**/
735,
/**/ /**/
734, 734,
/**/ /**/

View File

@@ -4762,18 +4762,20 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
} }
lvar = lookup_local(arg, varlen, cctx); lvar = lookup_local(arg, varlen, cctx);
if (lvar == NULL if (lvar == NULL)
&& lookup_arg(arg, varlen, {
CLEAR_FIELD(arg_lvar);
if (lookup_arg(arg, varlen,
&arg_lvar.lv_idx, &arg_lvar.lv_type, &arg_lvar.lv_idx, &arg_lvar.lv_type,
&arg_lvar.lv_from_outer, cctx) == OK) &arg_lvar.lv_from_outer, cctx) == OK)
{
if (is_decl)
{ {
semsg(_(e_used_as_arg), name); if (is_decl)
goto theend; {
semsg(_(e_used_as_arg), name);
goto theend;
}
lvar = &arg_lvar;
} }
arg_lvar.lv_const = 0;
lvar = &arg_lvar;
} }
if (lvar != NULL) if (lvar != NULL)
{ {