Commit 787bdd37 authored by Guido van Rossum's avatar Guido van Rossum

PyTuple_SetItem should require that the tuple's refcnt is one!

parent 607b33a1
......@@ -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;
......
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