aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/tag.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-07 11:04:33 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-11-07 14:25:32 +0800
commitd7bd7f13a8f026b8b95fdc49b4754f6199105891 (patch)
tree1fb13c11d6da35dc73af1936f9f15b91375c409a /src/nvim/tag.c
parent42e44d6d334bda8b97afe9e34a819ab293e5e10a (diff)
downloadrneovim-d7bd7f13a8f026b8b95fdc49b4754f6199105891.tar.gz
rneovim-d7bd7f13a8f026b8b95fdc49b4754f6199105891.tar.bz2
rneovim-d7bd7f13a8f026b8b95fdc49b4754f6199105891.zip
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 vim/vim#9293) https://github.com/vim/vim/commit/4dc24eb5adbcc76838fae1e900936dd230209d96 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'src/nvim/tag.c')
-rw-r--r--src/nvim/tag.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index 16d6629c2e..d57bbead63 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -154,7 +154,7 @@ void free_tagfunc_option(void)
void set_buflocal_tfu_callback(buf_T *buf)
{
callback_free(&buf->b_tfu_cb);
- if (tfu_cb.data.funcref != NULL && *tfu_cb.data.funcref != NUL) {
+ if (tfu_cb.type != kCallbackNone) {
callback_copy(&buf->b_tfu_cb, &tfu_cb);
}
}
@@ -1153,7 +1153,7 @@ static int find_tagfunc_tags(char_u *pat, garray_T *ga, int *match_count, int fl
}
}
- if (*curbuf->b_p_tfu == NUL) {
+ if (*curbuf->b_p_tfu == NUL || curbuf->b_tfu_cb.type == kCallbackNone) {
return FAIL;
}