diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-04 10:54:04 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-04 10:54:04 (GMT) |
commit | 1d0bb9c8f97b0f4fc6717f73555576f523965e42 (patch) | |
tree | c6fe486557438be079c676b0fb2fc3b80af8d772 /Modules/_functoolsmodule.c | |
parent | cfe34744e3c785a56525ab8a9473336206f5854d (diff) | |
parent | 19c4e0df29234355074fe7ec67857f0a0b7e0a18 (diff) | |
download | cpython-1d0bb9c8f97b0f4fc6717f73555576f523965e42.zip cpython-1d0bb9c8f97b0f4fc6717f73555576f523965e42.tar.gz cpython-1d0bb9c8f97b0f4fc6717f73555576f523965e42.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 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 */ }; |