ipmask_parse: Reject a full IPv6 address followed by ::.
authorMichael Poole <mdpoole@troilus.org>
Thu, 24 Sep 2015 23:54:41 +0000 (19:54 -0400)
committerMichael Poole <mdpoole@troilus.org>
Thu, 24 Sep 2015 23:54:41 +0000 (19:54 -0400)
ircd/ircd_string.c
ircd/test/ircd_in_addr_t.c

index 7785d58c60d57d9bccab5230b2f7c1040caf2950..ed0349ea45fc20b1d8700cc80c355b82317c0603 100644 (file)
@@ -578,6 +578,8 @@ ipmask_parse(const char *input, struct irc_in_addr *ip, unsigned char *pbits)
       if (input[pos] == ':') {
         if (colon < 8)
           return 0;
       if (input[pos] == ':') {
         if (colon < 8)
           return 0;
+        if (ii == 8)
+            return 0;
         colon = ii;
         pos++;
       }
         colon = ii;
         pos++;
       }
index af70be07bb12f176dbb0b6cfedd1f0ac06ce40e5..381460789508a7cb0911744a1b4b571ca9efae7e 100644 (file)
@@ -126,6 +126,8 @@ static struct ipmask_test test_masks[] = {
     { "0.0.0.0.0/1", {{ 0, 0, 0, 0, 0, 0, 0, 0 }}, 0, 0, 0 },
     { "2607:3f00:1:30c:9999*",
       {{ 0x2607, 0x3f00, 1, 0x30c, 0x9999, 0, 0, 0 }}, 1, 1, 80 },
     { "0.0.0.0.0/1", {{ 0, 0, 0, 0, 0, 0, 0, 0 }}, 0, 0, 0 },
     { "2607:3f00:1:30c:9999*",
       {{ 0x2607, 0x3f00, 1, 0x30c, 0x9999, 0, 0, 0 }}, 1, 1, 80 },
+    { "1234:5678:9abc:def0:feed:abba:cabb:1e55::",
+      {{ 0, 0, 0, 0, 0, 0, 0, 0 }}, 1, 0, 0 },
     { 0 }
 };
 
     { 0 }
 };