summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorYan Yanchii <yyanchiy@gmail.com>2024-12-25 17:42:04 (GMT)
committerGitHub <noreply@github.com>2024-12-25 17:42:04 (GMT)
commit5c814c83cdd3dc42bd9682106ffb7ade7ce6b5b3 (patch)
treec7891fc0dc79103a83e638efe78394c50f8d42a3 /Objects
parent81636d3bbd7f126692326bf957707e8a88c91739 (diff)
downloadcpython-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.c4
-rw-r--r--Objects/namespaceobject.c4
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;