diff --git a/src/detect-engine-address.c b/src/detect-engine-address.c index 4a98f4ced7..3f22f9adfa 100644 --- a/src/detect-engine-address.c +++ b/src/detect-engine-address.c @@ -444,9 +444,6 @@ static 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); @@ -647,6 +644,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\'");