mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.2977: crash when using a null function reference
Problem: Crash when using a null function reference. (Naohiro Ono) Solution: Check for an invalid function name. (closes #8367)
This commit is contained in:
@@ -3772,7 +3772,14 @@ call_func_rettv(
|
||||
s = partial_name(pt);
|
||||
}
|
||||
else
|
||||
{
|
||||
s = functv.vval.v_string;
|
||||
if (s == NULL || *s == NUL)
|
||||
{
|
||||
emsg(_(e_empty_function_name));
|
||||
goto theend;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
s = (char_u *)"";
|
||||
@@ -3786,6 +3793,7 @@ call_func_rettv(
|
||||
funcexe.basetv = basetv;
|
||||
ret = get_func_tv(s, -1, rettv, arg, evalarg, &funcexe);
|
||||
|
||||
theend:
|
||||
// Clear the funcref afterwards, so that deleting it while
|
||||
// evaluating the arguments is possible (see test55).
|
||||
if (evaluate)
|
||||
|
Reference in New Issue
Block a user