From 85741677c86f7686e3597a310f8059608e7816fb Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 15 Apr 2023 13:31:30 +0800 Subject: vim-patch:8.2.0634: crash with null partial and blob Problem: Crash with null partial and blob. Solution: Check for NULL pointer. Add more tests. (Yegappan Lakshmanan, closes vim/vim#5984) https://github.com/vim/vim/commit/92b83ccfda7a1d654ccaaf161a9c8a8e01fbcf76 Co-authored-by: Bram Moolenaar --- src/nvim/eval.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 46cd837a73..f555d973e4 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -4059,7 +4059,10 @@ char *partial_name(partial_T *pt) if (pt->pt_name != NULL) { return pt->pt_name; } - return pt->pt_func->uf_name; + if (pt->pt_func != NULL) { + return pt->pt_func->uf_name; + } + return ""; } static void partial_free(partial_T *pt) -- cgit