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)

fe8ebdbe5c

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
This commit is contained in:
zeertzjq
2023-04-16 08:55:42 +08:00
parent d13222649a
commit 08121ef69f
4 changed files with 18 additions and 8 deletions

View File

@@ -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 "";
}