diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-12 12:37:11 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-12 12:37:11 (GMT) |
commit | 616034eb736e9d1b45eefa2387b55a223d3bb0fd (patch) | |
tree | e767092432a0ccf31a48643683a1d9cc4403474d /Objects/unicodeobject.c | |
parent | c32f9db846ca6f66fa541aee73069d9324b863b7 (diff) | |
parent | babe4f8e5ede1f9a6f4206b97c303c8d33346b3b (diff) | |
download | cpython-616034eb736e9d1b45eefa2387b55a223d3bb0fd.zip cpython-616034eb736e9d1b45eefa2387b55a223d3bb0fd.tar.gz cpython-616034eb736e9d1b45eefa2387b55a223d3bb0fd.tar.bz2 |
Issue #28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
when decode astral characters.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index e22eed8..ab36357 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -5101,7 +5101,7 @@ _Py_DecodeUTF8_surrogateescape(const char *s, Py_ssize_t size) #if SIZEOF_WCHAR_T == 4 assert(0); #else - assert(Py_UNICODE_IS_SURROGATE(ch)); + assert(ch > 0xFFFF && ch <= MAX_UNICODE); /* compute and append the two surrogates: */ unicode[outpos++] = (wchar_t)Py_UNICODE_HIGH_SURROGATE(ch); unicode[outpos++] = (wchar_t)Py_UNICODE_LOW_SURROGATE(ch); |