diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-16 08:55:42 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-04-16 10:15:15 +0800 |
commit | 08121ef69f47f8ad8f8903a732920412e24d30c1 (patch) | |
tree | 82b56291fc2e45d3d668fb4f125312912d7c0df6 /src/nvim/eval.c | |
parent | d13222649a2145272f14675d9bbf64bb72c43f64 (diff) | |
download | rneovim-08121ef69f47f8ad8f8903a732920412e24d30c1.tar.gz rneovim-08121ef69f47f8ad8f8903a732920412e24d30c1.tar.bz2 rneovim-08121ef69f47f8ad8f8903a732920412e24d30c1.zip |
vim-patch:8.2.2848: crash whn calling partial
Problem: Crash whn calling partial.
Solution: Check for NULL pointer. (Dominique Pellé, closes vim/vim#8202)
https://github.com/vim/vim/commit/fe8ebdbe5c4e116311c0c0d5937b89ded5c92d01
Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 97cf0c6364..87633365b6 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -4175,11 +4175,13 @@ int eval_interp_string(char **arg, typval_T *rettv, bool evaluate) char *partial_name(partial_T *pt) FUNC_ATTR_PURE { - if (pt->pt_name != NULL) { - return pt->pt_name; - } - if (pt->pt_func != NULL) { - return pt->pt_func->uf_name; + if (pt != NULL) { + if (pt->pt_name != NULL) { + return pt->pt_name; + } + if (pt->pt_func != NULL) { + return pt->pt_func->uf_name; + } } return ""; } |