https://github.com/python/cpython/commit/fda901a1ff94ea6cc338b74928acdbc5ee165ed7
commit: fda901a1ff94ea6cc338b74928acdbc5ee165ed7
branch: main
author: Yan Yanchii <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2024-01-09T12:43:58+02:00
summary:

gh-113842: Add missing error check for PyIter_Next() in Python/symtable.c 
(GH-113843)

files:
M Python/symtable.c

diff --git a/Python/symtable.c b/Python/symtable.c
index 52d5932896b263..83137b491f282c 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -977,6 +977,12 @@ update_symbols(PyObject *symbols, PyObject *scopes,
         }
         Py_DECREF(name);
     }
+
+    /* Check if loop ended because of exception in PyIter_Next */
+    if (PyErr_Occurred()) {
+        goto error;
+    }
+
     Py_DECREF(itr);
     Py_DECREF(v_free);
     return 1;

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to