]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/parse: move spaces skip up the stack
authorPhilippe Antoine <contact@catenacyber.fr>
Wed, 9 Oct 2019 14:59:13 +0000 (16:59 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 18 Feb 2020 15:16:11 +0000 (16:16 +0100)
Switch to isspace() as well.

src/detect-engine-address.c

index 4a98f4ced768ec4da212f83b0ead4043ca3b32ec..3f22f9adfa495f690dfa256aa64d415c473e9da0 100644 (file)
@@ -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\'");