Skip to content

Commit

Permalink
patch 8.2.4269: Coverity warns for using a NULL pointer
Browse files Browse the repository at this point in the history
Problem:    Coverity warns for using a NULL pointer.
Solution:   Check for "name" to not be NULL.
  • Loading branch information
brammool committed Jan 31, 2022
1 parent 44d1f89 commit 48a6048
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/userfunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4232,7 +4232,8 @@ define_function(exarg_T *eap, char_u *name_arg, garray_T *lines_to_free)
name = prefixed;
}
}
else if (vim9script && vim_strchr(name, AUTOLOAD_CHAR) != NULL)
else if (vim9script && name != NULL
&& vim_strchr(name, AUTOLOAD_CHAR) != NULL)
{
emsg(_(e_cannot_use_name_with_hash_in_vim9_script_use_export_instead));
goto ret_free;
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4269,
/**/
4268,
/**/
Expand Down

0 comments on commit 48a6048

Please sign in to comment.