changeset 19215:45c062fa2156 v8.2.0166

patch 8.2.0166: Coverity warning for using uninitialized variable Commit: https://github.com/vim/vim/commit/07da94b0f07beb15c7e26b78837def5a91e102dc Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 28 22:39:19 2020 +0100 patch 8.2.0166: Coverity warning for using uninitialized variable Problem: Coverity warning for using uninitialized variable. Solution: Check for failure.
author Bram Moolenaar <Bram@vim.org>
date Tue, 28 Jan 2020 22:45:04 +0100
parents 5d7bcea37d94
children ee5cec77b9f0
files src/version.c src/vim9execute.c
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/version.c
+++ b/src/version.c
@@ -743,6 +743,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    166,
+/**/
     165,
 /**/
     164,
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -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;
 		}