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

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

index 2cc4ddd3c91daabc306b50c29c1cecc9ed956441..7082c6fd4657c60d26e219ebe03c83f5153baa9b 100644 (file)
@@ -121,6 +121,10 @@ namespace_repr(PyObject *ns)
             goto error;
     }
 
+    if (PyErr_Occurred()) {
+        goto error;
+    }
+
     separator = PyUnicode_FromString(", ");
     if (separator == NULL)
         goto error;