diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2021-12-07 12:23:57 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-12-07 12:23:57 +0000 |
commit | 4dc24eb5adbcc76838fae1e900936dd230209d96 (patch) | |
tree | 79f8deb9ac0294b4cbc228cbde0180ce205964c7 /src/job.c | |
parent | 92c33eb2735045d25fceed3b607f44d7156c59c1 (diff) |
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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; } /* |