From cd26fc139ec8766a73892174fd929e9478a050bc Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Mon, 20 Apr 2020 13:57:44 +0200 Subject: [PATCH] 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 --- src/detect-fast-pattern.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- 2.47.2