From: Jeremy Hylton Date: Thu, 20 Jun 2002 23:13:17 +0000 (+0000) Subject: Fix for SF bug 571885 X-Git-Tag: v2.3c1~5247 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b47dffc932fe1452a7f5fae70307c0915cd3591;p=python 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. --- diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 525e8f6e63..4c264fd46f 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -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;