Commit 742dd004 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X

when decode astral characters.
parent a78ea933
...@@ -10,6 +10,9 @@ What's New in Python 3.3.7? ...@@ -10,6 +10,9 @@ What's New in Python 3.3.7?
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 #26171: Fix possible integer overflow and heap corruption in - Issue #26171: Fix possible integer overflow and heap corruption in
zipimporter.get_data(). zipimporter.get_data().
......
...@@ -4896,7 +4896,7 @@ _Py_DecodeUTF8_surrogateescape(const char *s, Py_ssize_t size) ...@@ -4896,7 +4896,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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment