mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
vim-patch:8.2.3756: might crash when callback is not valid
Problem: might crash when callback is not valid.
Solution: Check for valid callback. (Yegappan Lakshmanan, closes vim/vim#9293)
4dc24eb5ad
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
@@ -1394,7 +1394,7 @@ func_call_skip_call:
|
||||
}
|
||||
|
||||
/// call the 'callback' function and return the result as a number.
|
||||
/// Returns -1 when calling the function fails. Uses argv[0] to argv[argc - 1]
|
||||
/// Returns -2 when calling the function fails. Uses argv[0] to argv[argc - 1]
|
||||
/// for the function arguments. argv[argc] should have type VAR_UNKNOWN.
|
||||
///
|
||||
/// @param argcount number of "argvars"
|
||||
@@ -1403,7 +1403,7 @@ varnumber_T callback_call_retnr(Callback *callback, int argcount, typval_T *argv
|
||||
{
|
||||
typval_T rettv;
|
||||
if (!callback_call(callback, argcount, argvars, &rettv)) {
|
||||
return -1;
|
||||
return -2;
|
||||
}
|
||||
|
||||
varnumber_T retval = tv_get_number_chk(&rettv, NULL);
|
||||
|
Reference in New Issue
Block a user