Skip to content

Commit

Permalink
gh-101952: Fix possible segfault in BUILD_SET opcode (#101958)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eclips4 committed Feb 16, 2023
1 parent 924a3bf commit 68bd8c5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
@@ -0,0 +1 @@
Fix possible segfault in ``BUILD_SET`` opcode, when new set created.
2 changes: 2 additions & 0 deletions Python/bytecodes.c
Expand Up @@ -1302,6 +1302,8 @@ dummy_func(

inst(BUILD_SET, (values[oparg] -- set)) {
set = PySet_New(NULL);
if (set == NULL)
goto error;
int err = 0;
for (int i = 0; i < oparg; i++) {
PyObject *item = values[i];
Expand Down
2 changes: 2 additions & 0 deletions Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 68bd8c5

Please sign in to comment.