diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-15 13:31:30 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-04-15 13:48:30 +0800 |
commit | 85741677c86f7686e3597a310f8059608e7816fb (patch) | |
tree | 2d203ebcd6609c1db6c61cde4d43fccb7424f341 /src | |
parent | 4b49f312a05214d5d1974f7ac2702ffb407fc558 (diff) | |
download | rneovim-85741677c86f7686e3597a310f8059608e7816fb.tar.gz rneovim-85741677c86f7686e3597a310f8059608e7816fb.tar.bz2 rneovim-85741677c86f7686e3597a310f8059608e7816fb.zip |
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 <Bram@vim.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 5 |
1 files changed, 4 insertions, 1 deletions
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) |