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-6.0.4~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=227d1d967a5902ed5732fee94563945f13887cc4;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 08f651a72e..199840b809 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)