changeset: 92945:4563fff4e099 branch: 3.4 parent: 92943:90c62e1f3658 user: Benjamin Peterson date: Fri Oct 10 20:58:30 2014 -0400 files: Modules/arraymodule.c description: prevent passing NULL to memcpy (closes #22605) Patch by Jakub Wilk. diff -r 90c62e1f3658 -r 4563fff4e099 Modules/arraymodule.c --- a/Modules/arraymodule.c Fri Oct 10 19:33:45 2014 -0400 +++ b/Modules/arraymodule.c Fri Oct 10 20:58:30 2014 -0400 @@ -2628,7 +2628,7 @@ 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);