summaryrefslogtreecommitdiff
path: root/src/job.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2021-12-07 12:23:57 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-07 12:23:57 +0000
commit4dc24eb5adbcc76838fae1e900936dd230209d96 (patch)
tree79f8deb9ac0294b4cbc228cbde0180ce205964c7 /src/job.c
parent92c33eb2735045d25fceed3b607f44d7156c59c1 (diff)
downloadvim-git-4dc24eb5adbcc76838fae1e900936dd230209d96.tar.gz
patch 8.2.3756: might crash when callback is not validv8.2.3756
Problem: might crash when callback is not valid. Solution: Check for valid callback. (Yegappan Lakshmanan, closes #9293)
Diffstat (limited to 'src/job.c')
-rw-r--r--src/job.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/job.c b/src/job.c
index ebe902fb0..6ee9f4432 100644
--- a/src/job.c
+++ b/src/job.c
@@ -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;
}
/*