core: check that regex is not NULL in function string_regcomp
parent
afa81c4594
commit
e0e3f9fdee
|
@ -922,6 +922,9 @@ string_regcomp (void *preg, const char *regex, int default_flags)
|
|||
const char *ptr_regex;
|
||||
int flags;
|
||||
|
||||
if (!regex)
|
||||
return -1;
|
||||
|
||||
ptr_regex = string_regex_flags (regex, default_flags, &flags);
|
||||
return regcomp ((regex_t *)preg, ptr_regex, flags);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue