From 9a42f621f5e8f1fb2aa2e8eb8e62d39305f21bee Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 19 Nov 2013 09:37:16 +0100 Subject: [PATCH] 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. --- src/detect-ipproto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }