1
0
forked from aniani/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 #9293)
This commit is contained in:
Yegappan Lakshmanan
2021-12-07 12:23:57 +00:00
committed by Bram Moolenaar
parent 92c33eb273
commit 4dc24eb5ad
9 changed files with 59 additions and 8 deletions

View File

@@ -1578,6 +1578,7 @@ invoke_prompt_interrupt(void)
{
typval_T rettv;
typval_T argv[1];
int ret;
if (curbuf->b_prompt_interrupt.cb_name == NULL
|| *curbuf->b_prompt_interrupt.cb_name == NUL)
@@ -1585,9 +1586,9 @@ invoke_prompt_interrupt(void)
argv[0].v_type = VAR_UNKNOWN;
got_int = FALSE; // don't skip executing commands
call_callback(&curbuf->b_prompt_interrupt, -1, &rettv, 0, argv);
ret = call_callback(&curbuf->b_prompt_interrupt, -1, &rettv, 0, argv);
clear_tv(&rettv);
return TRUE;
return ret == FAIL ? FALSE : TRUE;
}
/*