From: Philippe Antoine Date: Wed, 9 Oct 2019 14:59:13 +0000 (+0200) Subject: detect/parse: move spaces skip up the stack X-Git-Tag: suricata-5.0.3~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3a2ea081a5ade32dfa594fb2d9c05f3d7a0b7cc;p=thirdparty%2Fsuricata.git detect/parse: move spaces skip up the stack Switch to isspace() as well. (cherry picked from commit 52970d850858bb9784fe562422e9cf2c3aec4230) --- 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\'");