From 19e578a740057a69118149812ed2b240293a9a8e Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Wed, 18 Jan 2017 23:23:11 -0600 Subject: [PATCH] pcap-log: fix pcre_study error check Code was failing on a NULL return value which can be returned when there was nothing todo instead of an error. Instead check the errbuf for a non-NULL value to determine error. --- src/log-pcap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/log-pcap.c b/src/log-pcap.c index 70f4c6bf91..0d1a2f776a 100644 --- a/src/log-pcap.c +++ b/src/log-pcap.c @@ -962,7 +962,7 @@ static OutputCtx *PcapLogInitCtx(ConfNode *conf) timestamp_pattern, pcre_erroffset, pcre_errbuf); } pcre_timestamp_extra = pcre_study(pcre_timestamp_code, 0, &pcre_errbuf); - if (pcre_timestamp_extra == NULL) { + if (pcre_errbuf != NULL) { FatalError(SC_ERR_PCRE_STUDY, "Fail to study pcre: %s", pcre_errbuf); }