[issue22605] memcpy(NULL, NULL, 0) in array_new()

2014-10-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4563fff4e099 by Benjamin Peterson in branch '3.4': prevent passing NULL to memcpy (closes #22605) https://hg.python.org/cpython/rev/4563fff4e099 New changeset 8165e44594c2 by Benjamin Peterson in branch 'default': merge 3.4 (closes #22605) https://h

[issue22605] memcpy(NULL, NULL, 0) in array_new()

2014-10-10 Thread Jakub Wilk
New submission from Jakub Wilk: If you initialize array with another empty array, then this code runs: memcpy(self->ob_item, other->ob_item, len * other->ob_descr->itemsize); But self->ob_item and other->ob_item are NULL in such case. Passing null pointer to memcpy() is undefined behavior e

[issue22605] memcpy(NULL, NULL, 0) in array_new()

2014-10-10 Thread Jakub Wilk
Jakub Wilk added the comment: The attached patch should fix the bug. -- keywords: +patch Added file: http://bugs.python.org/file36871/229023.patch ___ Python tracker ___