From: Tomas Babej Date: Thu, 28 Jan 2016 14:05:01 +0000 (+0100) Subject: resolver: Reject lines with less than two tokens X-Git-Tag: v1.13.0~11^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F141%2Fhead;p=thirdparty%2Fdnspython.git resolver: Reject lines with less than two tokens --- diff --git a/dns/resolver.py b/dns/resolver.py index 55359fae..94360c4f 100644 --- a/dns/resolver.py +++ b/dns/resolver.py @@ -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':