]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Handle some invalid IPv6 literals we erroneously allowed.
authorBob Halley <halley@dnspython.org>
Fri, 14 Aug 2020 20:27:08 +0000 (13:27 -0700)
committerBob Halley <halley@dnspython.org>
Fri, 14 Aug 2020 20:27:08 +0000 (13:27 -0700)
dns/ipv6.py

index 0905aaf1a4f970469d95a645f05b7a54771fe799..faadb7c294b1756cf0a9d6ee553709dcb736b83b 100644 (file)
@@ -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.