]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/parse: move spaces skip up the stack 4718/head
authorPhilippe Antoine <contact@catenacyber.fr>
Wed, 9 Oct 2019 14:59:13 +0000 (16:59 +0200)
committerJeff Lucovsky <jeff@lucovsky.org>
Sun, 22 Mar 2020 17:45:54 +0000 (13:45 -0400)
Switch to isspace() as well.

(cherry picked from commit 52970d850858bb9784fe562422e9cf2c3aec4230)

src/detect-engine-address.c

index dc7803afa6f4ab95fe6764f3ef14a73ce78d1017..62b881f2ae844d8c568f10683f4be4d7372baa18 100644 (file)
@@ -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\'");