diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-08-21 22:21:19 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-08-21 22:21:19 (GMT) |
commit | 17753ecbfabc224080ef3e3e0801b7514ef3b455 (patch) | |
tree | 5b82040f4a72260e43278a3fe6eebc78f03a40d6 /Lib/test | |
parent | 0c6ae5bad473c57b3d5b2a3c71b26792e63df14c (diff) | |
download | cpython-17753ecbfabc224080ef3e3e0801b7514ef3b455.zip cpython-17753ecbfabc224080ef3e3e0801b7514ef3b455.tar.gz cpython-17753ecbfabc224080ef3e3e0801b7514ef3b455.tar.bz2 |
Patch #1541585: fix buffer overrun when performing repr() on
a unicode string in a build with wide unicode (UCS-4) support.
This code could be improved, so add an XXX comment.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_unicode.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 34f9371..1bc15ae 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -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) |