patch 8.2.3693: Coverity warns for possibly using a NULL pointer
Problem: Coverity warns for possibly using a NULL pointer.
Solution: Check for NULL and give an error.
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 7704635..de4de16 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -3189,6 +3189,12 @@
{
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);