mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
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.
This commit is contained in:
parent
0c6ae5bad4
commit
17753ecbfa
3 changed files with 34 additions and 12 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue