]> granicus.if.org Git - vim/commitdiff
patch 9.0.1055: Coverity warns for using uninitialized memory v9.0.1055
authorBram Moolenaar <Bram@vim.org>
Wed, 14 Dec 2022 13:50:02 +0000 (13:50 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 14 Dec 2022 13:50:02 +0000 (13:50 +0000)
Problem:    Coverity warns for using uninitialized memory.
Solution:   Clear the "lhs" field earlier.

src/version.c
src/vim9compile.c

index 6ab6ddc2fbf7b6e2270d7f8ba4b119f2a1f29a33..3a3795610c86c74e3856d1de10666a2aaba26a50 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1055,
 /**/
     1054,
 /**/
index 43bda5f0bd104adc5ba16ca441e08698a6aede0d..ac321a90e30910648fce9c982f31f483cff3742c 100644 (file)
@@ -2220,6 +2220,7 @@ compile_assignment(
     char_u     *sp;
     int                is_decl = is_decl_command(cmdidx);
     lhs_T      lhs;
+    CLEAR_FIELD(lhs);
     long       start_lnum = SOURCING_LNUM;
 
     int                has_arg_is_set_prefix = STRNCMP(arg, "ifargisset ", 11) == 0;
@@ -2244,8 +2245,6 @@ compile_assignment(
     if (p == NULL)
        return *arg == '[' ? arg : NULL;
 
-    lhs.lhs_name = NULL;
-
     if (eap->cmdidx == CMD_increment || eap->cmdidx == CMD_decrement)
     {
        if (VIM_ISWHITE(eap->cmd[2]))