Skip to content

Commit 50efd7d

Browse files
[3.11] gh-113842: Add missing error check for PyIter_Next() in Python/symtable.c (GH-113843) (GH-113852)
(cherry picked from commit fda901a) Co-authored-by: Yan Yanchii <[email protected]>
1 parent f20c692 commit 50efd7d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Python/symtable.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,12 @@ update_symbols(PyObject *symbols, PyObject *scopes,
728728
}
729729
Py_DECREF(name);
730730
}
731+
732+
/* Check if loop ended because of exception in PyIter_Next */
733+
if (PyErr_Occurred()) {
734+
goto error;
735+
}
736+
731737
Py_DECREF(itr);
732738
Py_DECREF(v_free);
733739
return 1;

0 commit comments

Comments
 (0)