diff options
author | Zackery Spytz <zspytz@gmail.com> | 2019-10-13 11:49:05 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2019-10-13 11:49:05 (GMT) |
commit | b16e382c446d76ede22780b15c75f43c5f132e25 (patch) | |
tree | 34c21fb3cdbd01798dd493e9afc52f2972b7bfbd /Objects/dictobject.c | |
parent | 793cb85437299a3da3d74fe65480d720af330cbb (diff) | |
download | cpython-b16e382c446d76ede22780b15c75f43c5f132e25.zip cpython-b16e382c446d76ede22780b15c75f43c5f132e25.tar.gz cpython-b16e382c446d76ede22780b15c75f43c5f132e25.tar.bz2 |
bpo-38202: Fix a crash in dict_view & non-itearble. (GH-16241)
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r-- | Objects/dictobject.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index b496350..64876e0 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -4227,6 +4227,10 @@ _PyDictView_Intersect(PyObject* self, PyObject *other) return NULL; it = PyObject_GetIter(other); + if (it == NULL) { + Py_DECREF(result); + return NULL; + } if (PyDictKeys_Check(self)) { dict_contains = dictkeys_contains; |