Skip to content

Commit

Permalink
[3.11] pythongh-113842: Add missing error check for PyIter_Next() in …
Browse files Browse the repository at this point in the history
…Python/symtable.c (pythonGH-113843) (pythonGH-113852)

(cherry picked from commit fda901a)

Co-authored-by: Yan Yanchii <yyanchiy@gmail.com>
  • Loading branch information
miss-islington and WolframAlph authored Jan 9, 2024
1 parent f20c692 commit 50efd7d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Python/symtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 50efd7d

Please sign in to comment.