0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.4847: crash when using uninitialized function pointer

Problem:    Crash when using uninitialized function pointer.
Solution:   Check for NULL pointer. (closes #10319, closes #10319)
This commit is contained in:
LemonBoy
2022-04-29 21:15:02 +01:00
committed by Bram Moolenaar
parent bad8a013c2
commit a5d3590505
3 changed files with 36 additions and 1 deletions

View File

@@ -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)
{