1
0
forked from aniani/vim

patch 7.4.1567

Problem:    Crash in assert_fails().
Solution:   Check for NULL. (Dominique Pelle)  Add a test.
This commit is contained in:
Bram Moolenaar
2016-03-15 13:33:55 +01:00
parent 4f118be2bb
commit 1abb502635
3 changed files with 10 additions and 1 deletions

View File

@@ -9386,7 +9386,8 @@ f_assert_fails(typval_T *argvars, typval_T *rettv UNUSED)
char_u buf[NUMBUFLEN];
char *error = (char *)get_tv_string_buf_chk(&argvars[1], buf);
if (strstr((char *)vimvars[VV_ERRMSG].vv_str, error) == NULL)
if (error == NULL
|| strstr((char *)vimvars[VV_ERRMSG].vv_str, error) == NULL)
{
prepare_assert_error(&ga);
fill_assert_error(&ga, &argvars[2], NULL, &argvars[1],