commit | 787bdd37a0817d038aff9ea45d06ceb14dccece4 | [log] [tgz] |
---|---|---|
author | Guido van Rossum <guido@python.org> | Sun Aug 17 16:25:45 1997 +0000 |
committer | Guido van Rossum <guido@python.org> | Sun Aug 17 16:25:45 1997 +0000 |
tree | e82c8a0798d79940103415d0b59bfbe4b2319e4b | |
parent | 607b33a1fe760859d5079cbe743fdc2364d3c6e7 [diff] [blame] |
PyTuple_SetItem should require that the tuple's refcnt is one!
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 0faedb4..d6fb6b4 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c
@@ -133,7 +133,7 @@ { 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;