summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorYan Yanchii <yyanchiy@gmail.com>2024-01-09 10:43:58 (GMT)
committerGitHub <noreply@github.com>2024-01-09 10:43:58 (GMT)
commitfda901a1ff94ea6cc338b74928acdbc5ee165ed7 (patch)
treec16ff1a35bb37efdc5f41fbd9c57709f5a416387 /Python
parent2e17cad2b8899126eb2024bf75db331b871bd5bc (diff)
downloadcpython-fda901a1ff94ea6cc338b74928acdbc5ee165ed7.zip
cpython-fda901a1ff94ea6cc338b74928acdbc5ee165ed7.tar.gz
cpython-fda901a1ff94ea6cc338b74928acdbc5ee165ed7.tar.bz2
gh-113842: Add missing error check for PyIter_Next() in Python/symtable.c (GH-113843)
Diffstat (limited to 'Python')
-rw-r--r--Python/symtable.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index 52d5932..83137b4 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;