mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
Issue #28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
when decode astral characters.
This commit is contained in:
commit
84293aff9f
2 changed files with 4 additions and 1 deletions
|
@ -10,6 +10,9 @@ Release date: TBA
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
|
||||||
|
when decode astral characters. Patch by Xiang Zhang.
|
||||||
|
|
||||||
- Issue #28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug
|
- Issue #28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug
|
||||||
build.
|
build.
|
||||||
|
|
||||||
|
|
|
@ -4856,7 +4856,7 @@ _Py_DecodeUTF8_surrogateescape(const char *s, Py_ssize_t size)
|
||||||
#if SIZEOF_WCHAR_T == 4
|
#if SIZEOF_WCHAR_T == 4
|
||||||
assert(0);
|
assert(0);
|
||||||
#else
|
#else
|
||||||
assert(Py_UNICODE_IS_SURROGATE(ch));
|
assert(ch > 0xFFFF && ch <= MAX_UNICODE);
|
||||||
/* compute and append the two surrogates: */
|
/* compute and append the two surrogates: */
|
||||||
unicode[outpos++] = (wchar_t)Py_UNICODE_HIGH_SURROGATE(ch);
|
unicode[outpos++] = (wchar_t)Py_UNICODE_HIGH_SURROGATE(ch);
|
||||||
unicode[outpos++] = (wchar_t)Py_UNICODE_LOW_SURROGATE(ch);
|
unicode[outpos++] = (wchar_t)Py_UNICODE_LOW_SURROGATE(ch);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue