]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: fix insertion in linked list for fast pattern
authorPhilippe Antoine <contact@catenacyber.fr>
Mon, 20 Apr 2020 11:57:44 +0000 (13:57 +0200)
committerJeff Lucovsky <jeff@lucovsky.org>
Fri, 24 Apr 2020 14:06:26 +0000 (10:06 -0400)
Make sure we do not add the same list_id twice
by checking at least all the lists with the current priority

(cherry picked from commit a0823bc6ecc0c9787fc148229331957fd55f9e97)

src/detect-fast-pattern.c

index 564178b6fe6e460e9c18a38d50eae8e396037797..e81a93f0b60ba11d71cc731188f79c7c26d391ae 100644 (file)
@@ -98,7 +98,11 @@ void SupportFastPatternForSigMatchList(int list_id, int priority)
             return;
         }
 
-        if (priority <= tmp->priority)
+        /* We need a strict check to be sure that the current list
+         * was not already registered
+         * and other lists with the same priority hide it.
+         */
+        if (priority < tmp->priority)
             break;
 
         ip = tmp;