]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: suppress error message for pcre only rules
authorVictor Julien <victor@inliniac.net>
Fri, 19 Feb 2021 10:45:00 +0000 (11:45 +0100)
committerJeff Lucovsky <jeff@lucovsky.org>
Tue, 5 Oct 2021 12:28:56 +0000 (08:28 -0400)
(cherry picked from commit 9dd1444f4431731bf4917488e0abec0d9a46fdcc)

src/detect-parse.c

index 85b4e7464b384e1eec0b5ac8ea6e8942f5fe694a..782ba840a20c1ce20f1c8c68b0e8bc901c117249 100644 (file)
@@ -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)