mirror of
https://github.com/python/cpython.git
synced 2025-08-24 02:35:59 +00:00
(Merge 3.3) Issue #17223: array module: Fix a crasher when converting an array
containing invalid characters (outside range [U+0000; U+10ffff]) to Unicode: repr(array), str(array) and array.tounicode(). Patch written by Manuel Jacob.
This commit is contained in:
commit
25c3053a4f
3 changed files with 12 additions and 0 deletions
|
@ -2177,6 +2177,8 @@ array_repr(arrayobject *a)
|
|||
} else {
|
||||
v = array_tolist(a, NULL);
|
||||
}
|
||||
if (v == NULL)
|
||||
return NULL;
|
||||
|
||||
s = PyUnicode_FromFormat("array('%c', %R)", (int)typecode, v);
|
||||
Py_DECREF(v);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue