From: Michael Poole Date: Thu, 24 Sep 2015 23:54:41 +0000 (-0400) Subject: ipmask_parse: Reject a full IPv6 address followed by ::. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=b7f25dcf93cc44cd9f5b4132c976e72118bcd44f ipmask_parse: Reject a full IPv6 address followed by ::. --- diff --git a/ircd/ircd_string.c b/ircd/ircd_string.c index 7785d58..ed0349e 100644 --- a/ircd/ircd_string.c +++ b/ircd/ircd_string.c @@ -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 (ii == 8) + return 0; colon = ii; pos++; } diff --git a/ircd/test/ircd_in_addr_t.c b/ircd/test/ircd_in_addr_t.c index af70be0..3814607 100644 --- a/ircd/test/ircd_in_addr_t.c +++ b/ircd/test/ircd_in_addr_t.c @@ -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 }, + { "1234:5678:9abc:def0:feed:abba:cabb:1e55::", + {{ 0, 0, 0, 0, 0, 0, 0, 0 }}, 1, 0, 0 }, { 0 } };