Fix unicode_aswidechar() for 4b unicode and 2b wchar_t (AIX).

This commit is contained in:
Georg Brandl 2014-10-01 19:15:11 +02:00
parent 51c116223e
commit ff3e5e3779
2 changed files with 7 additions and 1 deletions

View File

@ -7,6 +7,12 @@ What's New in Python 3.2.6?
*Release date: TBD*
Core and Builtins
-----------------
- Issue #19529: Fix a potential crash in converting Unicode objects to wchar_t
when Py_UNICODE is 4 bytes but wchar_t is 2 bytes, for example on AIX.
Library
-------

View File

@ -1267,7 +1267,7 @@ unicode_aswidechar(PyUnicodeObject *unicode,
Py_ssize_t nchar;
u = PyUnicode_AS_UNICODE(unicode);
uend = u + PyUnicode_GET_SIZE(u);
uend = u + PyUnicode_GET_SIZE(unicode);
if (w != NULL) {
worig = w;
wend = w + size;