From 9dd1444f4431731bf4917488e0abec0d9a46fdcc Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 19 Feb 2021 11:45:00 +0100 Subject: [PATCH] detect: suppress error message for pcre only rules --- src/detect-parse.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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)