]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
resolver: Reject lines with less than two tokens 141/head
authorTomas Babej <tomasbabej@gmail.com>
Thu, 28 Jan 2016 14:05:01 +0000 (15:05 +0100)
committerTomas Babej <tomasbabej@gmail.com>
Thu, 28 Jan 2016 14:05:01 +0000 (15:05 +0100)
dns/resolver.py

index 55359fae69fff8532dc42befec74264286256fea..94360c4fbd8e49efb499c97b2d7256b17b0d4453 100644 (file)
@@ -562,8 +562,11 @@ class Resolver(object):
                 if len(l) == 0 or l[0] == '#' or l[0] == ';':
                     continue
                 tokens = l.split()
-                if len(tokens) == 0:
+
+                # Any line containing less than 2 tokens is malformed
+                if len(tokens) < 2:
                     continue
+
                 if tokens[0] == 'nameserver':
                     self.nameservers.append(tokens[1])
                 elif tokens[0] == 'domain':