diff options
author | Yan Yanchii <yyanchiy@gmail.com> | 2024-12-25 17:42:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-25 17:42:04 (GMT) |
commit | 5c814c83cdd3dc42bd9682106ffb7ade7ce6b5b3 (patch) | |
tree | c7891fc0dc79103a83e638efe78394c50f8d42a3 /Objects | |
parent | 81636d3bbd7f126692326bf957707e8a88c91739 (diff) | |
download | cpython-5c814c83cdd3dc42bd9682106ffb7ade7ce6b5b3.zip cpython-5c814c83cdd3dc42bd9682106ffb7ade7ce6b5b3.tar.gz cpython-5c814c83cdd3dc42bd9682106ffb7ade7ce6b5b3.tar.bz2 |
gh-128198: Add missing error checks for usages of PyIter_Next() (GH-128199)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/frameobject.c | 4 | ||||
-rw-r--r-- | Objects/namespaceobject.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 10fd3a9..4f0040d 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -264,6 +264,10 @@ framelocalsproxy_merge(PyObject* self, PyObject* other) Py_DECREF(iter); + if (PyErr_Occurred()) { + return -1; + } + return 0; } diff --git a/Objects/namespaceobject.c b/Objects/namespaceobject.c index 5b75471..4ef3bd9 100644 --- a/Objects/namespaceobject.c +++ b/Objects/namespaceobject.c @@ -141,6 +141,10 @@ namespace_repr(PyObject *ns) goto error; } + if (PyErr_Occurred()) { + goto error; + } + separator = PyUnicode_FromString(", "); if (separator == NULL) goto error; |