- Patch #1541585: fix buffer overrun when performing repr() on

a unicode string in a build with wide unicode (UCS-4) support.

I will forward port to 2.6.  Can someone backport to 2.4?
This commit is contained in:
Neal Norwitz 2006-08-21 22:13:11 +00:00
parent bebdc9e52c
commit 19c35bba5d
4 changed files with 37 additions and 12 deletions

View file

@ -92,6 +92,10 @@ class UnicodeTest(
"\\xfe\\xff'")
testrepr = repr(u''.join(map(unichr, xrange(256))))
self.assertEqual(testrepr, latin1repr)
# Test repr works on wide unicode escapes without overflow.
self.assertEqual(repr(u"\U00010000" * 39 + u"\uffff" * 4096),
repr(u"\U00010000" * 39 + u"\uffff" * 4096))
def test_count(self):
string_tests.CommonTest.test_count(self)