From: Serhiy Storchaka Date: Thu, 26 Dec 2024 10:39:47 +0000 (+0200) Subject: [3.13] gh-128198: Add missing error checks for usages of PyIter_Next() (GH-128199... X-Git-Tag: v3.13.2~171 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c30cad06382d34f99e8d2512dad32e67a4bcf020;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-128198: Add missing error checks for usages of PyIter_Next() (GH-128199) (GH-128272) (cherry picked from commit 5c814c83cdd3dc42bd9682106ffb7ade7ce6b5b3) Co-authored-by: Yan Yanchii --- diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 44afda0c755a..8c596ede70ca 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -263,6 +263,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 5b7547103a2b..4ef3bd92f5a5 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;