Commit 3d9b91ce authored by Jeremy Hylton's avatar Jeremy Hylton

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.
parent 7051f4fa
...@@ -696,8 +696,8 @@ _PyTuple_Resize(PyObject **pv, int newsize) ...@@ -696,8 +696,8 @@ _PyTuple_Resize(PyObject **pv, int newsize)
_Py_NewReference((PyObject *) sv); _Py_NewReference((PyObject *) sv);
/* Zero out items added by growing */ /* Zero out items added by growing */
if (newsize > oldsize) if (newsize > oldsize)
memset(sv->ob_item, 0, memset(&sv->ob_item[oldsize], 0,
sizeof(*sv->ob_item) * (newsize - oldsize)); sizeof(*sv->ob_item) * (newsize - oldsize));
*pv = (PyObject *) sv; *pv = (PyObject *) sv;
_PyObject_GC_TRACK(sv); _PyObject_GC_TRACK(sv);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment