core: check that regex is not NULL in function string_regex_flags

v2.8-utf8proc
Sébastien Helleu 2014-07-05 10:15:29 +02:00
parent d936880392
commit afa81c4594
1 changed files with 4 additions and 1 deletions

View File

@ -854,10 +854,13 @@ string_regex_flags (const char *regex, int default_flags, int *flags)
int set_flag, flag;
char *pos;
ptr_regex = regex;
if (flags)
*flags = default_flags;
if (!regex)
return NULL;
ptr_regex = regex;
while (strncmp (ptr_regex, "(?", 2) == 0)
{
pos = strchr (ptr_regex, ')');