ip6addr_aton(): fail on three successive colons in an IPv6 address string

This commit is contained in:
goldsimon 2015-09-30 14:05:13 +02:00
parent 5a185a0fbd
commit 0621e8d1b1

View File

@ -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) {