mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Fix crash in itertools.cycle.__setstate__() caused by lack of type checking.
Will backport after the 3.6 release is done.
This commit is contained in:
parent
b468e1f595
commit
79c878d5f2
3 changed files with 37 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue