From: Victor Julien Date: Tue, 19 Nov 2013 08:37:16 +0000 (+0100) Subject: Fix pcre_study error check X-Git-Tag: suricata-2.0beta2~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a42f621f5e8f1fb2aa2e8eb8e62d39305f21bee;p=thirdparty%2Fsuricata.git 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. --- diff --git a/src/detect-ipproto.c b/src/detect-ipproto.c index f03b71b2c7..a71444785f 100644 --- a/src/detect-ipproto.c +++ b/src/detect-ipproto.c @@ -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; }