From a3a2ea081a5ade32dfa594fb2d9c05f3d7a0b7cc Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Wed, 9 Oct 2019 16:59:13 +0200 Subject: [PATCH] detect/parse: move spaces skip up the stack Switch to isspace() as well. (cherry picked from commit 52970d850858bb9784fe562422e9cf2c3aec4230) --- src/detect-engine-address.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/detect-engine-address.c b/src/detect-engine-address.c index dc7803afa6..62b881f2ae 100644 --- a/src/detect-engine-address.c +++ b/src/detect-engine-address.c @@ -529,9 +529,6 @@ int DetectAddressParseString(DetectAddress *dd, const char *str) int r = 0; char ipstr[256]; - while (*str != '\0' && *str == ' ') - str++; - /* shouldn't see 'any' here */ BUG_ON(strcasecmp(str, "any") == 0); @@ -738,6 +735,9 @@ static int DetectAddressSetup(DetectAddressHead *gh, const char *s) { SCLogDebug("gh %p, s %s", gh, s); + while (*s != '\0' && isspace(*s)) + s++; + if (strcasecmp(s, "any") == 0) { SCLogDebug("adding 0.0.0.0/0 and ::/0 as we\'re handling \'any\'"); -- 2.47.2