]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
PyTuple_SetItem should require that the tuple's refcnt is one!
authorGuido van Rossum <guido@python.org>
Sun, 17 Aug 1997 16:25:45 +0000 (16:25 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 17 Aug 1997 16:25:45 +0000 (16:25 +0000)
Objects/tupleobject.c

index 0faedb480aebf4f8e54f4ba9c1bc6f807a42c724..d6fb6b4d6457d18909dc28148d216790e6686b9f 100644 (file)
@@ -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;