comparison src/job.c @ 26452:65b4109a4297 v8.2.3756

patch 8.2.3756: might crash when callback is not valid Commit: https://github.com/vim/vim/commit/4dc24eb5adbcc76838fae1e900936dd230209d96 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Tue Dec 7 12:23:57 2021 +0000 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 https://github.com/vim/vim/issues/9293)
author Bram Moolenaar <Bram@vim.org>
date Tue, 07 Dec 2021 13:30:05 +0100
parents b18f3b0f317c
children d413104a94c8
comparison
equal deleted inserted replaced
26451:27720705109b 26452:65b4109a4297
1576 int 1576 int
1577 invoke_prompt_interrupt(void) 1577 invoke_prompt_interrupt(void)
1578 { 1578 {
1579 typval_T rettv; 1579 typval_T rettv;
1580 typval_T argv[1]; 1580 typval_T argv[1];
1581 int ret;
1581 1582
1582 if (curbuf->b_prompt_interrupt.cb_name == NULL 1583 if (curbuf->b_prompt_interrupt.cb_name == NULL
1583 || *curbuf->b_prompt_interrupt.cb_name == NUL) 1584 || *curbuf->b_prompt_interrupt.cb_name == NUL)
1584 return FALSE; 1585 return FALSE;
1585 argv[0].v_type = VAR_UNKNOWN; 1586 argv[0].v_type = VAR_UNKNOWN;
1586 1587
1587 got_int = FALSE; // don't skip executing commands 1588 got_int = FALSE; // don't skip executing commands
1588 call_callback(&curbuf->b_prompt_interrupt, -1, &rettv, 0, argv); 1589 ret = call_callback(&curbuf->b_prompt_interrupt, -1, &rettv, 0, argv);
1589 clear_tv(&rettv); 1590 clear_tv(&rettv);
1590 return TRUE; 1591 return ret == FAIL ? FALSE : TRUE;
1591 } 1592 }
1592 1593
1593 /* 1594 /*
1594 * Return the effective prompt for the specified buffer. 1595 * Return the effective prompt for the specified buffer.
1595 */ 1596 */