Skip to content

Commit ff3e5e3

Browse files
committed
Fix unicode_aswidechar() for 4b unicode and 2b wchar_t (AIX).
1 parent 51c1162 commit ff3e5e3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Misc/NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ What's New in Python 3.2.6?
77

88
*Release date: TBD*
99

10+
Core and Builtins
11+
-----------------
12+
13+
- Issue #19529: Fix a potential crash in converting Unicode objects to wchar_t
14+
when Py_UNICODE is 4 bytes but wchar_t is 2 bytes, for example on AIX.
15+
1016
Library
1117
-------
1218

Objects/unicodeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,7 @@ unicode_aswidechar(PyUnicodeObject *unicode,
12671267
Py_ssize_t nchar;
12681268

12691269
u = PyUnicode_AS_UNICODE(unicode);
1270-
uend = u + PyUnicode_GET_SIZE(u);
1270+
uend = u + PyUnicode_GET_SIZE(unicode);
12711271
if (w != NULL) {
12721272
worig = w;
12731273
wend = w + size;

0 commit comments

Comments
 (0)