]> granicus.if.org Git - vim/commitdiff
patch 8.2.4023: using uninitialized variable v8.2.4023
authorBram Moolenaar <Bram@vim.org>
Thu, 6 Jan 2022 22:07:57 +0000 (22:07 +0000)
committerBram Moolenaar <Bram@vim.org>
Thu, 6 Jan 2022 22:07:57 +0000 (22:07 +0000)
Problem:    Using uninitialized variable.
Solution:   Initialize "ufunc" also when an item is not exported.

src/version.c
src/vim9script.c

index 68c194b51c9faeffb20b6e0e28a806ba02b64b9a..cb331fa12c3aa71ea6b531497ac77d344c152a8a 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4023,
 /**/
     4022,
 /**/
index 815ded1eab07e08515010725905474c651638703..81f396759c25c7960c5ea260d31187581117a783 100644 (file)
@@ -565,6 +565,7 @@ find_exported(
     if (idx >= 0)
     {
        sv = ((svar_T *)script->sn_var_vals.ga_data) + idx;
+       *ufunc = NULL;
        if (!sv->sv_export)
        {
            if (verbose)
@@ -572,7 +573,6 @@ find_exported(
            return -1;
        }
        *type = sv->sv_type;
-       *ufunc = NULL;
     }
     else
     {