Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix heap-buffer-overflow
  • Loading branch information
Eclips4 committed Jan 29, 2025
commit ea07a50641b8af72bb401cfec5f6906fb383f090
12 changes: 8 additions & 4 deletions Python/flowgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -1810,13 +1810,17 @@ optimize_basic_block(PyObject *const_cache, basicblock *bb, PyObject *consts)
}
break;
case BUILD_LIST:
if (optimize_const_sequence(const_cache, inst-oparg, oparg, consts, 1, BUILD_LIST, LIST_EXTEND)) {
goto error;
if (i >= oparg) {
if (optimize_const_sequence(const_cache, inst-oparg, oparg, consts, 1, BUILD_LIST, LIST_EXTEND)) {
goto error;
}
}
break;
case BUILD_SET:
if (optimize_const_sequence(const_cache, inst-oparg, oparg, consts, 0, BUILD_SET, SET_UPDATE)) {
goto error;
if (i >= oparg) {
if (optimize_const_sequence(const_cache, inst-oparg, oparg, consts, 0, BUILD_SET, SET_UPDATE)) {
goto error;
}
}
break;
case POP_JUMP_IF_NOT_NONE:
Expand Down
Loading