From: Philippe Antoine Date: Mon, 20 Apr 2020 11:57:44 +0000 (+0200) Subject: detect: fix insertion in linked list for fast pattern X-Git-Tag: suricata-5.0.3~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfd825a8cceddeed761c1d1ae0598a0b17b1dc4e;p=thirdparty%2Fsuricata.git detect: fix insertion in linked list for fast pattern 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) --- diff --git a/src/detect-fast-pattern.c b/src/detect-fast-pattern.c index 564178b6fe..e81a93f0b6 100644 --- a/src/detect-fast-pattern.c +++ b/src/detect-fast-pattern.c @@ -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;