mirror of
https://github.com/python/cpython.git
synced 2026-05-06 20:51:17 -04:00
[3.11] gh-113842: Add missing error check for PyIter_Next() in Python/symtable.c (GH-113843) (GH-113852)
(cherry picked from commit fda901a1ff)
Co-authored-by: Yan Yanchii <yyanchiy@gmail.com>
This commit is contained in:
committed by
GitHub
parent
f20c69299e
commit
50efd7db20
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user