1
0
forked from aniani/vim

patch 7.4.1682

Problem:    Coverity: no check for NULL.
Solution:   Add check for invalid argument to assert_match().
This commit is contained in:
Bram Moolenaar 2016-03-28 22:48:29 +02:00
parent ef9d9b94a8
commit 72188e9aae
2 changed files with 5 additions and 1 deletions

View File

@ -9580,7 +9580,9 @@ f_assert_match(typval_T *argvars, typval_T *rettv UNUSED)
char_u *pat = get_tv_string_buf_chk(&argvars[0], buf1);
char_u *text = get_tv_string_buf_chk(&argvars[1], buf2);
if (!pattern_match(pat, text, FALSE))
if (pat == NULL || text == NULL)
EMSG(_(e_invarg));
else if (!pattern_match(pat, text, FALSE))
{
prepare_assert_error(&ga);
fill_assert_error(&ga, &argvars[2], NULL, &argvars[0], &argvars[1],

View File

@ -748,6 +748,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1682,
/**/
1681,
/**/