Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fda901a

Browse files
authored
gh-113842: Add missing error check for PyIter_Next() in Python/symtable.c (GH-113843)
1 parent 2e17cad commit fda901a

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
@@ -977,6 +977,12 @@ update_symbols(PyObject *symbols, PyObject *scopes,
977977
}
978978
Py_DECREF(name);
979979
}
980+
981+
/* Check if loop ended because of exception in PyIter_Next */
982+
if (PyErr_Occurred()) {
983+
goto error;
984+
}
985+
980986
Py_DECREF(itr);
981987
Py_DECREF(v_free);
982988
return 1;

0 commit comments

Comments
 (0)