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

Skip to content

Commit 0bd447f

Browse files
committed
Add missing check of PyDict_SetItem()'s return value in PyEval_EvalCodeEx()
CID 486647
1 parent 14f5ee0 commit 0bd447f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Python/ceval.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3333,7 +3333,9 @@ PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals,
33333333
keyword);
33343334
goto fail;
33353335
}
3336-
PyDict_SetItem(kwdict, keyword, value);
3336+
if (PyDict_SetItem(kwdict, keyword, value) == -1) {
3337+
goto fail;
3338+
}
33373339
continue;
33383340
kw_found:
33393341
if (GETLOCAL(j) != NULL) {

0 commit comments

Comments
 (0)