From: Bob Halley Date: Fri, 14 Aug 2020 20:27:08 +0000 (-0700) Subject: Handle some invalid IPv6 literals we erroneously allowed. X-Git-Tag: v2.1.0rc1~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f55f9ddeb82ddc7125d0347f438bfc13a1a6791f;p=thirdparty%2Fdnspython.git Handle some invalid IPv6 literals we erroneously allowed. --- diff --git a/dns/ipv6.py b/dns/ipv6.py index 0905aaf1..faadb7c2 100644 --- a/dns/ipv6.py +++ b/dns/ipv6.py @@ -121,7 +121,11 @@ def inet_aton(text, ignore_scope=False): elif l > 2: raise dns.exception.SyntaxError - if text == b'::': + if text == b'': + raise dns.exception.SyntaxError + elif text.endswith(b':') and not text.endswith(b'::'): + raise dns.exception.SyntaxError + elif text == b'::': text = b'0::' # # Get rid of the icky dot-quad syntax if we have it.