diff options
author | Bram Moolenaar <bram@vim.org> | 2011-11-30 15:19:28 +0100 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2011-11-30 15:19:28 +0100 |
commit | 41dd90aa5c50dc32bc082d8ed7d1ba1c6e7648b7 (patch) | |
tree | d435ef7a6c7aa8a79e68e980597a8acb9225a35e | |
parent | 3bce68ecd8300cfe6d2880d154f51e31abad452e (diff) | |
download | vim-41dd90aa5c50dc32bc082d8ed7d1ba1c6e7648b7.tar.gz |
Problem: Interrupting the load of an autoload function may cause a crash.
Solution: Do not use the hashitem when not valid. (Yukihiro Nakadaira)
-rw-r--r-- | src/eval.c | 9 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 9 insertions, 2 deletions
@@ -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; } diff --git a/src/version.c b/src/version.c index b186a736..1eadaec2 100644 --- a/src/version.c +++ b/src/version.c @@ -715,6 +715,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 360, +/**/ 359, /**/ 358, |