diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-04 10:47:24 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-04 10:47:24 (GMT) |
commit | 19c4e0df29234355074fe7ec67857f0a0b7e0a18 (patch) | |
tree | 55fc3001eeeb6613b9dbe948da9a1ec51c44f3c8 /Modules/_functoolsmodule.c | |
parent | 64359d203e95f243eec661baa4226509a8bb2909 (diff) | |
download | cpython-19c4e0df29234355074fe7ec67857f0a0b7e0a18.zip cpython-19c4e0df29234355074fe7ec67857f0a0b7e0a18.tar.gz cpython-19c4e0df29234355074fe7ec67857f0a0b7e0a18.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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index d8a283b..a0ea3ab 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -254,10 +254,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); @@ -281,7 +281,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 */ }; |