]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.0166: Coverity warning for using uninitialized variable v8.2.0166
authorBram Moolenaar <Bram@vim.org>
Tue, 28 Jan 2020 21:39:19 +0000 (22:39 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 28 Jan 2020 21:39:19 +0000 (22:39 +0100)
Problem:    Coverity warning for using uninitialized variable.
Solution:   Check for failure.

src/version.c
src/vim9execute.c

index 112b22cc781a026040c494b53e8dd6aace161222..d5108d9787ceaf119a55144982858f4a0ea56b05 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    166,
 /**/
     165,
 /**/
index f8efa1d6ca4a1ac4d610d1b321bf9db0d4406b11..001d2741105ef33ddcb54295356e0eef098fe421 100644 (file)
@@ -570,7 +570,12 @@ call_def_function(
 
                    if (ga_grow(&ectx.ec_stack, 1) == FAIL)
                        goto failed;
-                   get_env_tv(&name, &optval, TRUE);
+                   if (get_env_tv(&name, &optval, TRUE) == FAIL)
+                   {
+                       semsg(_("E1060: Invalid environment variable name: %s"),
+                                                        iptr->isn_arg.string);
+                       goto failed;
+                   }
                    *STACK_TV_BOT(0) = optval;
                    ++ectx.ec_stack.ga_len;
                }