summaryrefslogtreecommitdiffstats
path: root/Modules/_functoolsmodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-04 10:57:16 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-04 10:57:16 (GMT)
commitb6a53404b782c74bd9f7817ddb97f33642146d0c (patch)
tree79d7604ba115755b16ce1afe9c555c2f745482aa /Modules/_functoolsmodule.c
parenta4409c18eb55e3e76110af1ac88d8a8f6001d42f (diff)
parent1d0bb9c8f97b0f4fc6717f73555576f523965e42 (diff)
downloadcpython-b6a53404b782c74bd9f7817ddb97f33642146d0c.zip
cpython-b6a53404b782c74bd9f7817ddb97f33642146d0c.tar.gz
cpython-b6a53404b782c74bd9f7817ddb97f33642146d0c.tar.bz2
Issue #6083: Fix multiple segmentation faults occured when PyArg_ParseTuple
parses nested mutating sequence.
Diffstat (limited to 'Modules/_functoolsmodule.c')
-rw-r--r--Modules/_functoolsmodule.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c
index 3ff07bc..57dfba0 100644
--- a/Modules/_functoolsmodule.c
+++ b/Modules/_functoolsmodule.c
@@ -218,10 +218,10 @@ partial_reduce(partialobject *pto, PyObject *unused)
}
static PyObject *
-partial_setstate(partialobject *pto, PyObject *args)
+partial_setstate(partialobject *pto, PyObject *state)
{
PyObject *fn, *fnargs, *kw, *dict;
- if (!PyArg_ParseTuple(args, "(OOOO):__setstate__",
+ if (!PyArg_ParseTuple(state, "OOOO",
&fn, &fnargs, &kw, &dict))
return NULL;
Py_XDECREF(pto->fn);
@@ -245,7 +245,7 @@ partial_setstate(partialobject *pto, PyObject *args)
static PyMethodDef partial_methods[] = {
{"__reduce__", (PyCFunction)partial_reduce, METH_NOARGS},
- {"__setstate__", (PyCFunction)partial_setstate, METH_VARARGS},
+ {"__setstate__", (PyCFunction)partial_setstate, METH_O},
{NULL, NULL} /* sentinel */
};