Fix infinite loop in API function string_has_highlight_regex if regex is empty

v2.8-utf8proc
Sebastien Helleu 2010-12-09 23:09:49 +01:00
parent b4d58dd9da
commit ce269387a5
1 changed files with 1 additions and 1 deletions

View File

@ -766,7 +766,7 @@ string_has_highlight_regex (const char *string, const char *regex)
regex_t reg;
int rc;
if (!string || !regex)
if (!string || !regex || !regex[0])
return 0;
if (regcomp (&reg, regex, REG_EXTENDED) != 0)