Fix pcre_study error check

pcre_study returning NULL is not necessarily an error, from the man page
pcre_study(3):

  "If the function returns NULL, either it could not find any additional
   information, or there was an error. You can tell the difference by
   looking at the error value. It is NULL in first case."

Older libpcre versions would return NULL, causing errors.
pull/638/head
Victor Julien 13 years ago
parent c6a8d0ab6b
commit 9a42f621f5

@ -81,8 +81,8 @@ void DetectIPProtoRegister(void)
}
parse_regex_study = pcre_study(parse_regex, 0, &eb);
if (parse_regex_study == NULL || eb != NULL) {
SCLogError(SC_ERR_PCRE_STUDY, "pcre study failed: %s", eb ? eb : "unknown");
if (eb != NULL) {
SCLogError(SC_ERR_PCRE_STUDY, "pcre study failed: %s", eb);
goto error;
}

Loading…
Cancel
Save