mirror of
https://github.com/python/cpython.git
synced 2025-07-16 15:55:18 +00:00
Fix out of bound read in UTF-32 decoder on "narrow Unicode" builds.
This commit is contained in:
parent
f6fd794fac
commit
dec798eb46
1 changed files with 1 additions and 1 deletions
|
@ -3182,7 +3182,7 @@ PyUnicode_DecodeUTF32Stateful(const char *s,
|
||||||
/* On narrow builds we split characters outside the BMP into two
|
/* On narrow builds we split characters outside the BMP into two
|
||||||
codepoints => count how much extra space we need. */
|
codepoints => count how much extra space we need. */
|
||||||
#ifndef Py_UNICODE_WIDE
|
#ifndef Py_UNICODE_WIDE
|
||||||
for (qq = q; qq < e; qq += 4)
|
for (qq = q; e - qq >= 4; qq += 4)
|
||||||
if (qq[iorder[2]] != 0 || qq[iorder[3]] != 0)
|
if (qq[iorder[2]] != 0 || qq[iorder[3]] != 0)
|
||||||
pairs++;
|
pairs++;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue