summaryrefslogtreecommitdiff
path: root/dns
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2014-06-18 16:13:39 -0700
committerBob Halley <halley@dnspython.org>2014-06-18 16:13:39 -0700
commitb2dac7593f03793f7695a8e137d26a0a25140b44 (patch)
treec0a5c2949b17b2d68a69a8f3bf4ed53644821360 /dns
parent2671293f470d998093d1ba0abe699591676fb951 (diff)
downloaddnspython-b2dac7593f03793f7695a8e137d26a0a25140b44.tar.gz
Allow empty APL RR.
Diffstat (limited to 'dns')
-rw-r--r--dns/rdtypes/IN/APL.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/dns/rdtypes/IN/APL.py b/dns/rdtypes/IN/APL.py
index 260fd6f..59da75b 100644
--- a/dns/rdtypes/IN/APL.py
+++ b/dns/rdtypes/IN/APL.py
@@ -118,6 +118,8 @@ class APL(dns.rdata.Rdata):
def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin = None):
items = []
while 1:
+ if rdlen == 0:
+ break
if rdlen < 4:
raise dns.exception.FormError
header = struct.unpack('!HBB', wire[current : current + 4])
@@ -151,8 +153,6 @@ class APL(dns.rdata.Rdata):
rdlen -= afdlen
item = APLItem(header[0], negation, address, header[1])
items.append(item)
- if rdlen == 0:
- break
return cls(rdclass, rdtype, items)
from_wire = classmethod(from_wire)