]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-128198: Add missing error checks for usages of PyIter_Next() (GH-128199...
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 26 Dec 2024 10:39:47 +0000 (12:39 +0200)
committerGitHub <noreply@github.com>
Thu, 26 Dec 2024 10:39:47 +0000 (10:39 +0000)
(cherry picked from commit 5c814c83cdd3dc42bd9682106ffb7ade7ce6b5b3)

Co-authored-by: Yan Yanchii <yyanchiy@gmail.com>
Objects/frameobject.c
Objects/namespaceobject.c

index 44afda0c755ab0a627b58b6b46af4053af854f47..8c596ede70ca3d861b9dc613c5b6718b253cb4a1 100644 (file)
@@ -263,6 +263,10 @@ framelocalsproxy_merge(PyObject* self, PyObject* other)
 
     Py_DECREF(iter);
 
+    if (PyErr_Occurred()) {
+        return -1;
+    }
+
     return 0;
 }
 
index 5b7547103a2b3fc5f239effe70a45934a3b6e056..4ef3bd92f5a56968cf490817f1a60e54c2756637 100644 (file)
@@ -141,6 +141,10 @@ namespace_repr(PyObject *ns)
             goto error;
     }
 
+    if (PyErr_Occurred()) {
+        goto error;
+    }
+
     separator = PyUnicode_FromString(", ");
     if (separator == NULL)
         goto error;