Skip to content

Commit 72188e9

Browse files
committed
patch 7.4.1682
Problem: Coverity: no check for NULL. Solution: Add check for invalid argument to assert_match().
1 parent ef9d9b9 commit 72188e9

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/eval.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9580,7 +9580,9 @@ f_assert_match(typval_T *argvars, typval_T *rettv UNUSED)
95809580
char_u *pat = get_tv_string_buf_chk(&argvars[0], buf1);
95819581
char_u *text = get_tv_string_buf_chk(&argvars[1], buf2);
95829582

9583-
if (!pattern_match(pat, text, FALSE))
9583+
if (pat == NULL || text == NULL)
9584+
EMSG(_(e_invarg));
9585+
else if (!pattern_match(pat, text, FALSE))
95849586
{
95859587
prepare_assert_error(&ga);
95869588
fill_assert_error(&ga, &argvars[2], NULL, &argvars[0], &argvars[1],

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,8 @@ static char *(features[]) =
748748

749749
static int included_patches[] =
750750
{ /* Add new patch number below this line */
751+
/**/
752+
1682,
751753
/**/
752754
1681,
753755
/**/

0 commit comments

Comments
 (0)