vim-patch:7.4.1567

Problem:    Crash in assert_fails().
Solution:   Check for NULL. (Dominique Pelle)  Add a test.

1abb502635
This commit is contained in:
James McCoy
2016-05-25 17:13:23 -04:00
parent bc306ab5aa
commit ccef5c9c77
3 changed files with 21 additions and 2 deletions

View File

@@ -7688,7 +7688,8 @@ static void f_assert_fails(typval_T *argvars, typval_T *rettv)
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],
&vimvars[VV_ERRMSG].vv_tv);