Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Close a minor NULL dereference opportunity in compile.c. Found by Kirit
Sankar Gupta.
5 changes: 5 additions & 0 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -3360,6 +3360,11 @@ compiler_subdict(struct compiler *c, expr_ty e, Py_ssize_t begin, Py_ssize_t end
}
for (i = begin; i < end; i++) {
key = get_const_value((expr_ty)asdl_seq_GET(e->v.Dict.keys, i));
if (key == NULL) {
Py_DECREF(keys);
PyErr_BadInternalCall();
return 0;
}
Py_INCREF(key);
PyTuple_SET_ITEM(keys, i - begin, key);
}
Expand Down