summaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-11-30 15:19:28 +0100
committerBram Moolenaar <Bram@vim.org>2011-11-30 15:19:28 +0100
commit8000baffa7bc80773d4a80769837e73e5c5715b5 (patch)
tree4b3ab48385ac53929ce94a7e935d63a40b5c7d7a /src/eval.c
parent195ea0ff6cbb15e5e18dcade13b612ddd7e9d68e (diff)
updated for version 7.3.360v7.3.360
Problem: Interrupting the load of an autoload function may cause a crash. Solution: Do not use the hashitem when not valid. (Yukihiro Nakadaira)
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/eval.c b/src/eval.c
index 8474956398..d93836a894 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -19589,9 +19589,14 @@ find_var_in_ht(ht, varname, writing)
* worked find the variable again. Don't auto-load a script if it was
* loaded already, otherwise it would be loaded every time when
* checking if a function name is a Funcref variable. */
- if (ht == &globvarht && !writing
- && script_autoload(varname, FALSE) && !aborting())
+ if (ht == &globvarht && !writing)
+ {
+ /* Note: script_autoload() may make "hi" invalid. It must either
+ * be obtained again or not used. */
+ if (!script_autoload(varname, FALSE) || aborting())
+ return NULL;
hi = hash_find(ht, varname);
+ }
if (HASHITEM_EMPTY(hi))
return NULL;
}