detect/engine: fix whitelisting check

In the commit 4a00ae607, the whitelisting check was updated in a quest
to make use of the conditional better but it made things worse as every
range would be whitelisted as long as it had any of the default
whitelisted port which is very common.
pull/10569/head
Victor Julien 3 years ago committed by Victor Julien
parent 566e89a0d6
commit fb9680bb7b

@ -1076,7 +1076,7 @@ static int PortIsWhitelisted(const DetectEngineCtx *de_ctx,
while (w) {
/* Make sure the whitelist port falls in the port range of a */
DEBUG_VALIDATE_BUG_ON(a->port > a->port2);
if (w->port >= a->port && w->port <= a->port2) {
if (a->port == w->port && w->port2 == a->port2) {
return 1;
}
w = w->next;

Loading…
Cancel
Save