diff src/eval.c @ 28646:a2cf17d0d5da v8.2.4847

patch 8.2.4847: crash when using uninitialized function pointer Commit: https://github.com/vim/vim/commit/a5d3590505fc3e1deea990560d472baa563abed7 Author: LemonBoy <thatlemon@gmail.com> Date: Fri Apr 29 21:15:02 2022 +0100 patch 8.2.4847: crash when using uninitialized function pointer Problem: Crash when using uninitialized function pointer. Solution: Check for NULL pointer. (closes https://github.com/vim/vim/issues/10319, closes https://github.com/vim/vim/issues/10319)
author Bram Moolenaar <Bram@vim.org>
date Fri, 29 Apr 2022 22:30:03 +0200
parents daf785caecf2
children 9a7a2908e1a8
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -5314,7 +5314,8 @@ echo_string_core(
 
 		if (echo_style)
 		{
-		    r = make_ufunc_name_readable(tv->vval.v_string,
+		    r = tv->vval.v_string == NULL ? (char_u *)"function()"
+				  : make_ufunc_name_readable(tv->vval.v_string,
 						       buf, MAX_FUNC_NAME_LEN);
 		    if (r == buf)
 		    {