Skip to content

Commit

Permalink
patch 8.2.3693: Coverity warns for possibly using a NULL pointer
Browse files Browse the repository at this point in the history
Problem:    Coverity warns for possibly using a NULL pointer.
Solution:   Check for NULL and give an error.
  • Loading branch information
brammool committed Nov 29, 2021
1 parent 3845352 commit 293eb9b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,8 @@ EXTERN char e_cannot_delete_vim9_script_function_str[]
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_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
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3693,
/**/
3692,
/**/
Expand Down
6 changes: 6 additions & 0 deletions src/vim9execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -3189,6 +3189,12 @@ exec_instructions(ectx_T *ectx)
{
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);
Expand Down

0 comments on commit 293eb9b

Please sign in to comment.