diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-08-28 12:49:27 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-08-28 12:49:27 +0200 |
commit | 60b6e6f6cc60ac99253e1c13bd0cae4ef0e43201 (patch) | |
tree | 7439ed4ba5579a8c36daa2de2d6820644521e696 /src/evalfunc.c | |
parent | 271906bc067a8f25422016665001d2e44cf618e2 (diff) |
patch 8.2.3380: crash when using NULL string for funcref()v8.2.3380
Problem: Crash when using NULL string for funcref().
Solution: Check for NULL argument. (issue #8260)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index d6fb03ee40..287ca3c3ff 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -3932,6 +3932,11 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref) s = tv_get_string(&argvars[0]); use_string = TRUE; } + if (s == NULL) + { + semsg(_(e_invarg2), "NULL"); + return; + } if ((use_string && vim_strchr(s, AUTOLOAD_CHAR) == NULL) || is_funcref) { |