summaryrefslogtreecommitdiff
path: root/dns
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2014-08-31 17:14:05 -0700
committerBob Halley <halley@dnspython.org>2014-08-31 17:14:05 -0700
commite758ab4e7513f359e6deaf5725dcdd4ffa007d9a (patch)
treea728298bc9011ede88da74f05de234d30c1e286f /dns
parenteb195a787259c957c80355566512b4e9c5da5219 (diff)
downloaddnspython-e758ab4e7513f359e6deaf5725dcdd4ffa007d9a.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 a7b8510..58e35b6 100644
--- a/dns/rdtypes/IN/APL.py
+++ b/dns/rdtypes/IN/APL.py
@@ -119,6 +119,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])
@@ -152,8 +154,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)