changeset 27024:5d851ce07caf v8.2.4041

patch 8.2.4041: using unitialized pointer Commit: https://github.com/vim/vim/commit/aa9b3cacd52a6c34591bbd89fb6b06d4c097fe03 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 8 15:44:22 2022 +0000 patch 8.2.4041: using unitialized pointer Problem: Using unitialized pointer. Solution: Store "ht" when variable is in another script.
author Bram Moolenaar <Bram@vim.org>
date Sat, 08 Jan 2022 16:45:03 +0100
parents 77aed3cffbd3
children 4aa691048c1c
files src/evalvars.c src/version.c
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -2898,7 +2898,11 @@ find_var_also_in_script(char_u *name, ha
 		dictitem_T *di = find_var_in_ht(ht, 0, p + 1, no_autoload);
 
 		if (di != NULL)
+		{
+		    if (htp != NULL)
+			*htp = ht;
 		    return di;
+		}
 	    }
 	}
     }
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    4041,
+/**/
     4040,
 /**/
     4039,