]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
leading zero detection in dns.ipv4.inet_aton() was broken
authorBob Halley <halley@dnspython.org>
Sat, 23 May 2020 20:58:34 +0000 (13:58 -0700)
committerBob Halley <halley@dnspython.org>
Sat, 23 May 2020 20:58:34 +0000 (13:58 -0700)
dns/ipv4.py

index 9d4370b619d78a6171ca4c8acf3b4a4dc860143e..e1f38d3d4fcf0123fee1a124541b2d3dc6bf0ccf 100644 (file)
@@ -50,7 +50,7 @@ def inet_aton(text):
     for part in parts:
         if not part.isdigit():
             raise dns.exception.SyntaxError
-        if len(part) > 1 and part[0] == '0':
+        if len(part) > 1 and part[0] == ord('0'):
             # No leading zeros
             raise dns.exception.SyntaxError
     try: