mirror of https://github.com/python/cpython
Add a safety limit to the number of unicode characters we fetch
(followup to r84635, suggested by Dave Malcolm).
This commit is contained in:
parent
b41e128fe1
commit
b1856d7fa7
|
@ -1103,7 +1103,8 @@ class PyUnicodeObjectPtr(PyObjectPtr):
|
|||
# inferior process: we must join surrogate pairs.
|
||||
Py_UNICODEs = []
|
||||
i = 0
|
||||
while i < field_length:
|
||||
limit = safety_limit(field_length)
|
||||
while i < limit:
|
||||
ucs = int(field_str[i])
|
||||
i += 1
|
||||
if ucs < 0xD800 or ucs >= 0xDC00 or i == field_length:
|
||||
|
|
Loading…
Reference in New Issue