]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxtables: ignore whitespace in the multiaddress argument parser
authorJan Engelhardt <jengelh@medozas.de>
Sat, 9 Jul 2011 14:19:09 +0000 (16:19 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Sat, 9 Jul 2011 14:19:40 +0000 (16:19 +0200)
References: http://bugzilla.netfilter.org/show_bug.cgi?id=727
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
iptables/xtables.c

index 3b173959cd7bfbfb520b4da3fb5e27b92b063365..0f02592036b3a708c3e41adf2513091f4a84bacc 100644 (file)
@@ -1314,6 +1314,8 @@ void xtables_ipparse_multiple(const char *name, struct in_addr **addrpp,
        loop = name;
 
        for (i = 0; i < count; ++i) {
+               while (isspace(*loop))
+                       ++loop;
                next = strchr(loop, ',');
                if (next != NULL)
                        len = next - loop;
@@ -1628,6 +1630,8 @@ xtables_ip6parse_multiple(const char *name, struct in6_addr **addrpp,
        loop = name;
 
        for (i = 0; i < count /*NB: count can grow*/; ++i) {
+               while (isspace(*loop))
+                       ++loop;
                next = strchr(loop, ',');
                if (next != NULL)
                        len = next - loop;