From: Victor Julien Date: Fri, 19 Feb 2021 10:45:00 +0000 (+0100) Subject: detect: suppress error message for pcre only rules X-Git-Tag: suricata-7.0.0-beta1~1737 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9dd1444f4431731bf4917488e0abec0d9a46fdcc;p=thirdparty%2Fsuricata.git detect: suppress error message for pcre only rules --- diff --git a/src/detect-parse.c b/src/detect-parse.c index c3c0b6b179..e29423f2b2 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -624,10 +624,11 @@ static void SigMatchTransferSigMatchAcrossLists(SigMatch *sm, int SigMatchListSMBelongsTo(const Signature *s, const SigMatch *key_sm) { - const int nlists = s->init_data->smlists_array_size; - int list = 0; + if (key_sm == NULL) + return -1; - for (list = 0; list < nlists; list++) { + const int nlists = s->init_data->smlists_array_size; + for (int list = 0; list < nlists; list++) { const SigMatch *sm = s->init_data->smlists[list]; while (sm != NULL) { if (sm == key_sm)