From 04f98c593793f3bab93380e852a974837bbcf74e Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Mon, 28 Dec 2009 11:04:07 +0530 Subject: [PATCH] double port/address negation is parsed incorrectly --- src/detect-engine-port.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/src/detect-engine-port.c b/src/detect-engine-port.c index afb31c0..5be1120 100644 --- a/src/detect-engine-port.c +++ b/src/detect-engine-port.c @@ -2454,6 +2454,19 @@ int PortTestMatchReal19() return PortTestMatchRealWrp(sig, 1); } +static int PortTestMatchDoubleNegation(void) +{ + int result = 0; + DetectPort *head = NULL, *nhead = NULL; + + if (DetectPortParseDo(&head, &nhead, "![!80]", 0) == -1) + return result; + + result = (head != NULL); + result = (nhead == NULL); + + return result; +} #endif /* UNITTESTS */ @@ -2499,6 +2512,9 @@ void DetectPortTests(void) { UtRegisterTest("PortTestMatchReal18", PortTestMatchReal18, 1); UtRegisterTest("PortTestMatchReal19 (expected to fail, see bug #8)", PortTestMatchReal19, 1); + UtRegisterTest("PortTestMatchDoubleNegation", PortTestMatchDoubleNegation, 1); + + #endif /* UNITTESTS */ } -- 1.5.5