comparison 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
comparison
equal deleted inserted replaced
28645:a9eca6be0c8c 28646:a2cf17d0d5da
5312 { 5312 {
5313 char_u buf[MAX_FUNC_NAME_LEN]; 5313 char_u buf[MAX_FUNC_NAME_LEN];
5314 5314
5315 if (echo_style) 5315 if (echo_style)
5316 { 5316 {
5317 r = make_ufunc_name_readable(tv->vval.v_string, 5317 r = tv->vval.v_string == NULL ? (char_u *)"function()"
5318 : make_ufunc_name_readable(tv->vval.v_string,
5318 buf, MAX_FUNC_NAME_LEN); 5319 buf, MAX_FUNC_NAME_LEN);
5319 if (r == buf) 5320 if (r == buf)
5320 { 5321 {
5321 r = vim_strsave(buf); 5322 r = vim_strsave(buf);
5322 *tofree = r; 5323 *tofree = r;