summaryrefslogtreecommitdiffstats
path: root/Modules/arraymodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-02-25 23:27:56 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-02-25 23:27:56 (GMT)
commit25c3053a4f65fecaa7dfcabdbd7627a425d1a812 (patch)
tree8618dd858dd7495689ec674a1d1569a37c1a3df2 /Modules/arraymodule.c
parent36025478bff1012dbb6d9312aca4a798ee089e8e (diff)
parent29ec595c6a705428784d24eb7e03681637c4eb03 (diff)
downloadcpython-25c3053a4f65fecaa7dfcabdbd7627a425d1a812.zip
cpython-25c3053a4f65fecaa7dfcabdbd7627a425d1a812.tar.gz
cpython-25c3053a4f65fecaa7dfcabdbd7627a425d1a812.tar.bz2
(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.
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r--Modules/arraymodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index a0e89d4..1c75989 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -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);