From: Guido van Rossum Date: Sun, 17 Aug 1997 16:25:45 +0000 (+0000) Subject: PyTuple_SetItem should require that the tuple's refcnt is one! X-Git-Tag: v1.5a4~389 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=787bdd37a0817d038aff9ea45d06ceb14dccece4;p=thirdparty%2FPython%2Fcpython.git PyTuple_SetItem should require that the tuple's refcnt is one! --- diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 0faedb480aeb..d6fb6b4d6457 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -133,7 +133,7 @@ PyTuple_SetItem(op, i, newitem) { register PyObject *olditem; register PyObject **p; - if (!PyTuple_Check(op)) { + if (!PyTuple_Check(op) || op->ob_refcnt != 1) { Py_XDECREF(newitem); PyErr_BadInternalCall(); return -1;