Annotation of pkgsrc/lang/python27/patches/patch-Lib_test_test__codecs.py, revision 1.1

1.1     ! gutterid    1: $NetBSD$
        !             2: 
        !             3: Security fix for CVE-2022-45061: CPU denial of service via inefficient IDNA decoder
        !             4: Via Fedora:
        !             5: https://src.fedoraproject.org/rpms/python2.7/raw/64f3700b7679f9f8a385d99e3862a758b14e1d28/f/00394-cve-2022-45061-cpu-denial-of-service-via-inefficient-idna-decoder.patch
        !             6: 
        !             7: --- Lib/test/test_codecs.py.orig       2020-04-19 21:13:39.000000000 +0000
        !             8: +++ Lib/test/test_codecs.py
        !             9: @@ -1318,6 +1318,12 @@ class IDNACodecTest(unittest.TestCase):
        !            10:          self.assertEqual(u"pyth\xf6n.org".encode("idna"), "xn--pythn-mua.org")
        !            11:          self.assertEqual(u"pyth\xf6n.org.".encode("idna"), "xn--pythn-mua.org.")
        !            12:  
        !            13: +    def test_builtin_decode_length_limit(self):
        !            14: +        with self.assertRaisesRegexp(UnicodeError, "too long"):
        !            15: +            (b"xn--016c"+b"a"*1100).decode("idna")
        !            16: +        with self.assertRaisesRegexp(UnicodeError, "too long"):
        !            17: +            (b"xn--016c"+b"a"*70).decode("idna")
        !            18: +
        !            19:      def test_stream(self):
        !            20:          import StringIO
        !            21:          r = codecs.getreader("idna")(StringIO.StringIO("abc"))

CVSweb <webmaster@jp.NetBSD.org>