summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2013-04-28 09:21:37 +0100
committerBob Halley <halley@dnspython.org>2013-04-28 09:21:37 +0100
commitb139c1d70fac0e6ab4fd926f05658876d7036eb0 (patch)
treef64ab694b727743047fe69d16b1298bdf888b8df
parentdaa371c882ae009ff023175f6e74c572ff2a6e0f (diff)
downloaddnspython-b139c1d70fac0e6ab4fd926f05658876d7036eb0.tar.gz
Do not add items with offsets >= 2^14 to the compression table
-rw-r--r--ChangeLog6
-rw-r--r--dns/name.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ef4ab5f..2db5b02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-04-28 Bob Halley <halley@dnspython.org>
+
+ * dns/name.py (Name.to_wire): Do not add items with offsets >= 2^14
+ to the compression table. Thanks to Casey Deccio for discovering
+ this bug.
+
2013-04-26 Bob Halley <halley@dnspython.org>
* dns/ipv6.py (inet_ntoa): We now comply with RFC 5952 section
diff --git a/dns/name.py b/dns/name.py
index ed3ffee..293ab95 100644
--- a/dns/name.py
+++ b/dns/name.py
@@ -419,7 +419,7 @@ class Name(object):
else:
if not compress is None and len(n) > 1:
pos = file.tell()
- if pos < 0xc000:
+ if pos <= 0x3fff:
compress[n] = pos
l = len(label)
file.write(chr(l))