From 0621e8d1b11f09852c6fbaa8744d51a22699018d Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 30 Sep 2015 14:05:13 +0200 Subject: [PATCH] ip6addr_aton(): fail on three successive colons in an IPv6 address string --- src/core/ipv6/ip6_addr.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/ipv6/ip6_addr.c b/src/core/ipv6/ip6_addr.c index d11e8095..1717e481 100644 --- a/src/core/ipv6/ip6_addr.c +++ b/src/core/ipv6/ip6_addr.c @@ -107,6 +107,10 @@ ip6addr_aton(const char *cp, ip6_addr_t *addr) return 0; } if (s[1] == ':') { + if (s[2] == ':') { + /* invalid format: three successive colons */ + return 0; + } s++; /* "::" found, set zeros */ while (zero_blocks > 0) {