diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-12 14:36:02 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-12 14:36:02 +0200 |
commit | 09ccde227ad276348ae9524c4f7ed3d8b9cabbf2 (patch) | |
tree | 39b24c3941bfe4e31feadb1d1dbe62c25e474abc /Objects | |
parent | 05d55677195ee35e8726718c17714407f3047215 (diff) | |
parent | b51bd875193c84e51afb907a0c8ff6091fc95d5f (diff) | |
download | cpython-09ccde227ad276348ae9524c4f7ed3d8b9cabbf2.tar.gz |
Issue #28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
when decode astral characters.
Diffstat (limited to 'Objects')
-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 249cf578d9..7c383628a6 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -5120,7 +5120,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); |