summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2015-08-15 20:51:59 (GMT)
committerRaymond Hettinger <python@rcn.com>2015-08-15 20:51:59 (GMT)
commit79c878d5f24d58fe09e842f9a1cc13d6cf560aab (patch)
tree8e8e80a8209a5dca3b746325b1cb3627e5985ac0 /Modules
parentb468e1f59533fd296df7d899e9a71650871f30ce (diff)
downloadcpython-79c878d5f24d58fe09e842f9a1cc13d6cf560aab.zip
cpython-79c878d5f24d58fe09e842f9a1cc13d6cf560aab.tar.gz
cpython-79c878d5f24d58fe09e842f9a1cc13d6cf560aab.tar.bz2
Fix crash in itertools.cycle.__setstate__() caused by lack of type checking.
Will backport after the 3.6 release is done.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/itertoolsmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 349da0f..2cca6b3 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -973,7 +973,7 @@ cycle_setstate(cycleobject *lz, PyObject *state)
{
PyObject *saved=NULL;
int firstpass;
- if (!PyArg_ParseTuple(state, "Oi", &saved, &firstpass))
+ if (!PyArg_ParseTuple(state, "O!i", &PyList_Type, &saved, &firstpass))
return NULL;
Py_CLEAR(lz->saved);
lz->saved = saved;