1
0
forked from aniani/vim

patch 8.0.1408: crash in setqflist()

Problem:    Crash in setqflist().
Solution:   Check for string to be NULL. (Dominique Pelle, closes #2464)
This commit is contained in:
Bram Moolenaar
2017-12-19 10:22:19 +01:00
parent 4af031dbc8
commit a0ca7d002d
3 changed files with 21 additions and 3 deletions

View File

@@ -4930,8 +4930,9 @@ qf_get_properties(win_T *wp, dict_T *what, dict_T *retdict)
qf_idx = -1;
}
}
else if ((di->di_tv.v_type == VAR_STRING)
&& (STRCMP(di->di_tv.vval.v_string, "$") == 0))
else if (di->di_tv.v_type == VAR_STRING
&& di->di_tv.vval.v_string != NULL
&& STRCMP(di->di_tv.vval.v_string, "$") == 0)
/* Get the last quickfix list number */
qf_idx = qi->qf_listcount - 1;
else
@@ -5226,7 +5227,8 @@ qf_set_properties(qf_info_T *qi, dict_T *what, int action, char_u *title)
newlist = FALSE; /* use the specified list */
}
else if (di->di_tv.v_type == VAR_STRING
&& STRCMP(di->di_tv.vval.v_string, "$") == 0)
&& di->di_tv.vval.v_string != NULL
&& STRCMP(di->di_tv.vval.v_string, "$") == 0)
{
if (qi->qf_listcount > 0)
qf_idx = qi->qf_listcount - 1;