0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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

@@ -7210,7 +7210,7 @@ option_set_callback_func(char_u *optval UNUSED, callback_T *optcb UNUSED)
return FAIL;
cb = get_callback(tv);
if (cb.cb_name == NULL)
if (cb.cb_name == NULL || *cb.cb_name == NUL)
{
free_tv(tv);
return FAIL;