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-6.0.0-beta1~490 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd26fc139ec8766a73892174fd929e9478a050bc;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 --- diff --git a/src/detect-fast-pattern.c b/src/detect-fast-pattern.c index a43ac67d24..da34a0653a 100644 --- a/src/detect-fast-pattern.c +++ b/src/detect-fast-pattern.c @@ -97,7 +97,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;