1
0
forked from aniani/vim

patch 8.2.3380: crash when using NULL string for funcref()

Problem:    Crash when using NULL string for funcref().
Solution:   Check for NULL argument. (issue #8260)
This commit is contained in:
Bram Moolenaar
2021-08-28 12:49:27 +02:00
parent 271906bc06
commit 60b6e6f6cc
3 changed files with 8 additions and 0 deletions

View File

@@ -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)
{