diff options
author | Bob Halley <halley@dnspython.org> | 2012-08-28 13:51:59 -0700 |
---|---|---|
committer | Bob Halley <halley@dnspython.org> | 2012-08-28 13:51:59 -0700 |
commit | b05d56031c7ff6bceca4ed8788d49fe8b04a7da6 (patch) | |
tree | 1400a61ec7b0d02e61c4a8ad0406d315f6f00145 /dns | |
parent | cdf87c2ea5935fc31e2ce7137b4c589de0e091c2 (diff) | |
download | dnspython-b05d56031c7ff6bceca4ed8788d49fe8b04a7da6.tar.gz |
Do not generate empty NSEC3 bitmap windows
Diffstat (limited to 'dns')
-rw-r--r-- | dns/rdtypes/ANY/NSEC3.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/dns/rdtypes/ANY/NSEC3.py b/dns/rdtypes/ANY/NSEC3.py index c7ac737..b42fe4c 100644 --- a/dns/rdtypes/ANY/NSEC3.py +++ b/dns/rdtypes/ANY/NSEC3.py @@ -114,7 +114,8 @@ class NSEC3(dns.rdata.Rdata): prior_rdtype = nrdtype new_window = nrdtype // 256 if new_window != window: - windows.append((window, ''.join(bitmap[0:octets]))) + if octets != 0: + windows.append((window, ''.join(bitmap[0:octets]))) bitmap = ['\0'] * 32 window = new_window offset = nrdtype % 256 @@ -122,7 +123,8 @@ class NSEC3(dns.rdata.Rdata): bit = offset % 8 octets = byte + 1 bitmap[byte] = chr(ord(bitmap[byte]) | (0x80 >> bit)) - windows.append((window, ''.join(bitmap[0:octets]))) + if octets != 0: + windows.append((window, ''.join(bitmap[0:octets]))) return cls(rdclass, rdtype, algorithm, flags, iterations, salt, next, windows) from_text = classmethod(from_text) |