diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-01-09 11:09:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-09 11:09:32 (GMT) |
commit | 50efd7db20a3073affd877ecd2edd1dcf2a2c8b9 (patch) | |
tree | 04ef7b39e041466073ed2b6f8237301aeb32ecb8 /Python | |
parent | f20c69299e026813de2a97ddb32e89155f08fdff (diff) | |
download | cpython-50efd7db20a3073affd877ecd2edd1dcf2a2c8b9.zip cpython-50efd7db20a3073affd877ecd2edd1dcf2a2c8b9.tar.gz cpython-50efd7db20a3073affd877ecd2edd1dcf2a2c8b9.tar.bz2 |
[3.11] gh-113842: Add missing error check for PyIter_Next() in Python/symtable.c (GH-113843) (GH-113852)
(cherry picked from commit fda901a1ff94ea6cc338b74928acdbc5ee165ed7)
Co-authored-by: Yan Yanchii <yyanchiy@gmail.com>
Diffstat (limited to 'Python')
-rw-r--r-- | Python/symtable.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index 37e5c69..3519f62 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -728,6 +728,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; |