Package: release.debian.org Severity: normal Tags: stretch User: release.debian....@packages.debian.org Usertags: pu
Please see the attached patch. It's a simple enough fix from upstream for an issue that is causing crashes for a user. I've uploaded this change to unstable. I'll make sure I wait until it's in testing before uploading the pu, even if I get the ack before. Scott K
>From 0ec9807a6233bd5e5856c79fb3d53e37331f3617 Mon Sep 17 00:00:00 2001 From: Scott Kitterman <sc...@kitterman.com> Date: Fri, 7 Dec 2018 08:24:23 -0500 Subject: [PATCH] Add debian/patches/0002-fix-error-when-parsing-nsec3-bitmap-from- text.patch from upstream (Closes: #915866) Conflicts: debian/changelog --- debian/changelog | 7 +++ ...error-when-parsing-nsec3-bitmap-from-text.patch | 70 ++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 78 insertions(+) create mode 100644 debian/patches/0002-fix-error-when-parsing-nsec3-bitmap-from-text.patch diff --git a/debian/changelog b/debian/changelog index a5d9a0b..2d231ad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +dnspython (1.15.0-1+deb9u1) UNRELEASED; urgency=medium + + * Add debian/patches/0002-fix-error-when-parsing-nsec3-bitmap-from- + text.patch from upstream (Closes: #915866) + + -- Scott Kitterman <sc...@kitterman.com> Fri, 07 Dec 2018 08:23:43 -0500 + dnspython (1.15.0-1) unstable; urgency=medium * New upstream release diff --git a/debian/patches/0002-fix-error-when-parsing-nsec3-bitmap-from-text.patch b/debian/patches/0002-fix-error-when-parsing-nsec3-bitmap-from-text.patch new file mode 100644 index 0000000..b1c6f4d --- /dev/null +++ b/debian/patches/0002-fix-error-when-parsing-nsec3-bitmap-from-text.patch @@ -0,0 +1,70 @@ +From: =?utf-8?q?Filip_=C5=A0irok=C3=BD?= <filip.sir...@nic.cz> +Date: Thu, 13 Jul 2017 17:01:19 +0200 +Subject: fix error when parsing nsec3 bitmap from text + +Exception is raised when parsing nsec3 bitmap into multiple windows +Add test to prove the change fixes the issue +--- + dns/rdtypes/ANY/NSEC3.py | 2 +- + tests/test_nsec3.py | 39 +++++++++++++++++++++++++++++++++++++++ + 2 files changed, 40 insertions(+), 1 deletion(-) + create mode 100644 tests/test_nsec3.py + +diff --git a/dns/rdtypes/ANY/NSEC3.py b/dns/rdtypes/ANY/NSEC3.py +index 9a15687..6f21847 100644 +--- a/dns/rdtypes/ANY/NSEC3.py ++++ b/dns/rdtypes/ANY/NSEC3.py +@@ -130,7 +130,7 @@ class NSEC3(dns.rdata.Rdata): + new_window = nrdtype // 256 + if new_window != window: + if octets != 0: +- windows.append((window, ''.join(bitmap[0:octets]))) ++ windows.append((window, bitmap[0:octets])) + bitmap = bytearray(b'\0' * 32) + window = new_window + offset = nrdtype % 256 +diff --git a/tests/test_nsec3.py b/tests/test_nsec3.py +new file mode 100644 +index 0000000..261c124 +--- /dev/null ++++ b/tests/test_nsec3.py +@@ -0,0 +1,39 @@ ++# Copyright (C) 2006-2017 Nominum, Inc. ++# ++# Permission to use, copy, modify, and distribute this software and its ++# documentation for any purpose with or without fee is hereby granted, ++# provided that the above copyright notice and this permission notice ++# appear in all copies. ++# ++# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES ++# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR ++# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ++# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT ++# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ ++try: ++ import unittest2 as unittest ++except ImportError: ++ import unittest ++ ++import dns.rdata ++import dns.rdataclass ++import dns.rdatatype ++import dns.rdtypes.ANY.TXT ++import dns.ttl ++ ++class NSEC3TestCase(unittest.TestCase): ++ def test_NSEC3_bitmap(self): ++ rdata = dns.rdata.from_text(dns.rdataclass.IN, dns.rdatatype.NSEC3, ++ u"1 0 100 ABCD SCBCQHKU35969L2A68P3AD59LHF30715 A CAA TYPE65534") ++ bitmap = bytearray(b'\0' * 32) ++ bitmap[31] = bitmap[31] | 2 ++ self.assertEqual(rdata.windows, [(0, bytearray(b'@')), ++ (1, bytearray(b'@')), # CAA = 257 ++ (255, bitmap) ++ ]) ++ ++if __name__ == '__main__': ++ unittest.main() diff --git a/debian/patches/series b/debian/patches/series index 84a1d92..52cb494 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ 0001-Fix-file-write-location-in-testToFileFilename.patch +0002-fix-error-when-parsing-nsec3-bitmap-from-text.patch -- 1.9.1