mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Fix for SF bug 571885
When resizing a tuple, zero out the memory starting at the end of the old tuple not at the beginning of the old tuple.
This commit is contained in:
parent
fc7d379a96
commit
8b47dffc93
1 changed files with 2 additions and 2 deletions
|
@ -696,8 +696,8 @@ _PyTuple_Resize(PyObject **pv, int newsize)
|
|||
_Py_NewReference((PyObject *) sv);
|
||||
/* Zero out items added by growing */
|
||||
if (newsize > oldsize)
|
||||
memset(sv->ob_item, 0,
|
||||
sizeof(*sv->ob_item) * (newsize - oldsize));
|
||||
memset(&sv->ob_item[oldsize], 0,
|
||||
sizeof(*sv->ob_item) * (newsize - oldsize));
|
||||
*pv = (PyObject *) sv;
|
||||
_PyObject_GC_TRACK(sv);
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue