coverity/125476: RI: Null pointer dereference

This commit is contained in:
Justin M. Keyes 2016-01-25 02:12:06 -05:00
parent e1d81178cc
commit c15e796211
2 changed files with 12 additions and 6 deletions

View File

@ -10786,15 +10786,15 @@ static void f_globpath(typval_T *argvars, typval_T *rettv)
} }
} }
/* // "glob2regpat()" function
* "glob2regpat()" function
*/
static void f_glob2regpat(typval_T *argvars, typval_T *rettv) static void f_glob2regpat(typval_T *argvars, typval_T *rettv)
{ {
char_u *pat = get_tv_string_chk(&argvars[0]); char_u *pat = get_tv_string_chk(&argvars[0]); // NULL on type error
rettv->v_type = VAR_STRING; rettv->v_type = VAR_STRING;
rettv->vval.v_string = file_pat_to_reg_pat(pat, NULL, NULL, FALSE); rettv->vval.v_string = (pat == NULL)
? NULL
: file_pat_to_reg_pat(pat, NULL, NULL, false);
} }
/* /*

View File

@ -69,6 +69,12 @@ static char *features[] = {
// clang-format off // clang-format off
static int included_patches[] = { static int included_patches[] = {
1081,
1055, 1055,
// 1054, // 1054,
// 1053, // 1053,