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-5.0.8~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c97819a4b1d800de8f25f62ddd849b32dad90f37;p=thirdparty%2Fsuricata.git detect: suppress error message for pcre only rules (cherry picked from commit 9dd1444f4431731bf4917488e0abec0d9a46fdcc) --- diff --git a/src/detect-parse.c b/src/detect-parse.c index 85b4e7464b..782ba840a2 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)