To: vim_dev@googlegroups.com Subject: Patch 8.2.3693 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3693 Problem: Coverity warns for possibly using a NULL pointer. Solution: Check for NULL and give an error. Files: src/vim9execute.c, src/errors.h *** ../vim-8.2.3692/src/vim9execute.c 2021-11-28 22:00:08.148081412 +0000 --- src/vim9execute.c 2021-11-29 10:33:46.949284246 +0000 *************** *** 3189,3194 **** --- 3189,3200 ---- { ufunc = find_func(funcref->fr_func_name, FALSE, NULL); } + if (ufunc == NULL) + { + SOURCING_LNUM = iptr->isn_lnum; + emsg(_(e_function_reference_invalid)); + goto theend; + } if (fill_partial_and_closure(pt, ufunc, ectx) == FAIL) goto theend; tv = STACK_TV_BOT(0); *** ../vim-8.2.3692/src/errors.h 2021-11-28 22:00:08.148081412 +0000 --- src/errors.h 2021-11-29 10:33:40.189304991 +0000 *************** *** 355,361 **** INIT(= N_("E1084: Cannot delete Vim9 script function %s")); EXTERN char e_not_callable_type_str[] INIT(= N_("E1085: Not a callable type: %s")); ! // E1086 unused EXTERN char e_cannot_use_index_when_declaring_variable[] INIT(= N_("E1087: Cannot use an index when declaring a variable")); // E1088 unused --- 355,362 ---- INIT(= N_("E1084: Cannot delete Vim9 script function %s")); EXTERN char e_not_callable_type_str[] INIT(= N_("E1085: Not a callable type: %s")); ! EXTERN char e_function_reference_invalid[] ! INIT(= N_("E1086: Function reference invalid")); EXTERN char e_cannot_use_index_when_declaring_variable[] INIT(= N_("E1087: Cannot use an index when declaring a variable")); // E1088 unused *** ../vim-8.2.3692/src/version.c 2021-11-28 22:00:08.152081403 +0000 --- src/version.c 2021-11-29 10:34:41.833115872 +0000 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 3693, /**/ -- We apologise again for the fault in the subtitles. Those responsible for sacking the people who have just been sacked have been sacked. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///