summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-10-11 00:58:43 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-10-11 00:58:43 (GMT)
commit588dad0308b781d19adfc62f623b1842dc47ae2f (patch)
treeb995f24417490a25c4b7ae17a23dd544356b7c0d /Modules
parentda821db8375f5637530f05a22c66e9aeee733d91 (diff)
parent682124ccc3c7e07006ca99346f749689a5229459 (diff)
downloadcpython-588dad0308b781d19adfc62f623b1842dc47ae2f.zip
cpython-588dad0308b781d19adfc62f623b1842dc47ae2f.tar.gz
cpython-588dad0308b781d19adfc62f623b1842dc47ae2f.tar.bz2
merge 3.4 (closes #22605)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/arraymodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index a7bd6d8..f15571d 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -2709,7 +2709,7 @@ array_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
self->allocated = Py_SIZE(self);
}
}
- else if (initial != NULL && array_Check(initial)) {
+ else if (initial != NULL && array_Check(initial) && len > 0) {
arrayobject *self = (arrayobject *)a;
arrayobject *other = (arrayobject *)initial;
memcpy(self->ob_item, other->ob_item, len * other->ob_descr->itemsize);