diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-03-30 17:40:02 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-03-30 17:40:02 (GMT) |
commit | fbb1c5ee068d209e33f6e15ecb4821d5d8b107fa (patch) | |
tree | 4ae6657a598c5cfe5357f3106d956ed721d83e24 /Objects/dictobject.c | |
parent | 13b3acd13e35b5e619c3d1aab90aaf54abc1fb53 (diff) | |
download | cpython-fbb1c5ee068d209e33f6e15ecb4821d5d8b107fa.zip cpython-fbb1c5ee068d209e33f6e15ecb4821d5d8b107fa.tar.gz cpython-fbb1c5ee068d209e33f6e15ecb4821d5d8b107fa.tar.bz2 |
Issue #26494: Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r-- | Objects/dictobject.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index e4dff98..d774586 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -2985,8 +2985,8 @@ static PyObject *dictiter_iternextkey(dictiterobject *di) return key; fail: - Py_DECREF(d); di->di_dict = NULL; + Py_DECREF(d); return NULL; } @@ -3066,8 +3066,8 @@ static PyObject *dictiter_iternextvalue(dictiterobject *di) return value; fail: - Py_DECREF(d); di->di_dict = NULL; + Py_DECREF(d); return NULL; } @@ -3161,8 +3161,8 @@ static PyObject *dictiter_iternextitem(dictiterobject *di) return result; fail: - Py_DECREF(d); di->di_dict = NULL; + Py_DECREF(d); return NULL; } |