summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-04-06 19:04:10 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-04-06 19:04:10 (GMT)
commitbb84565cdb243521126137b818c411bef429f86d (patch)
treed8f6debc319b3f132af8580868b1f94d9ba2b030 /Objects
parent9c6eb266f5c275a4836f32720f37451c4f14c50d (diff)
downloadcpython-bb84565cdb243521126137b818c411bef429f86d.zip
cpython-bb84565cdb243521126137b818c411bef429f86d.tar.gz
cpython-bb84565cdb243521126137b818c411bef429f86d.tar.bz2
Issue #14010: Fix a crash when iterating or deleting deeply nested filters
in itertools module (i.e. itertools.izip(), itertools.chain(), etc).
Diffstat (limited to 'Objects')
-rw-r--r--Objects/abstract.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 3c88711..bc247e5 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -3104,7 +3104,10 @@ PyObject *
PyIter_Next(PyObject *iter)
{
PyObject *result;
+ if (Py_EnterRecursiveCall(" while iterating"))
+ return NULL;
result = (*iter->ob_type->tp_iternext)(iter);
+ Py_LeaveRecursiveCall();
if (result == NULL &&
PyErr_Occurred() &&
PyErr_ExceptionMatches(PyExc_StopIteration))