diff options
author | Raymond Hettinger <python@rcn.com> | 2015-08-15 20:51:59 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2015-08-15 20:51:59 (GMT) |
commit | 79c878d5f24d58fe09e842f9a1cc13d6cf560aab (patch) | |
tree | 8e8e80a8209a5dca3b746325b1cb3627e5985ac0 /Modules | |
parent | b468e1f59533fd296df7d899e9a71650871f30ce (diff) | |
download | cpython-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.c | 2 |
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; |