commit a274bdf2d16b2330bdf18732c1f65ee71aaf5c61
parent f15c28ed7a852ccab8de6ac3e38d167187cc183e
Author: zeertzjq <zeertzjq@outlook.com>
Date: Fri, 19 Dec 2025 15:47:29 +0800
vim-patch:8.2.3767: crash when using NULL partial
Problem: Crash when using NULL partial.
Solution: Check for NULL.
https://github.com/vim/vim/commit/e8a92b6166e32f8e583e01c9f541cf81cf76f8e6
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/nvim/eval/typval_encode.c.h b/src/nvim/eval/typval_encode.c.h
@@ -354,7 +354,7 @@ static int TYPVAL_ENCODE_CONVERT_ONE_VALUE(
partial_T *const pt = tv->vval.v_partial;
char *const fun = pt == NULL ? NULL : partial_name(pt);
// When using uf_name prepend "g:" for a global function.
- const char *const prefix = fun != NULL && pt->pt_name == NULL
+ const char *const prefix = fun != NULL && pt != NULL && pt->pt_name == NULL
&& ASCII_ISUPPER(fun[0]) ? "g:" : "";
(void)prefix;
TYPVAL_ENCODE_CONV_FUNC_START(tv, fun, prefix);