From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 9 Jan 2024 11:09:32 +0000 (+0100) Subject: [3.11] gh-113842: Add missing error check for PyIter_Next() in Python/symtable.c... X-Git-Tag: v3.11.8~179 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=50efd7db20a3073affd877ecd2edd1dcf2a2c8b9;p=thirdparty%2FPython%2Fcpython.git [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 --- diff --git a/Python/symtable.c b/Python/symtable.c index 37e5c697405b..3519f6209842 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;