Skip to content

Commit 68bd8c5

Browse files
authored
gh-101952: Fix possible segfault in BUILD_SET opcode (#101958)
1 parent 924a3bf commit 68bd8c5

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix possible segfault in ``BUILD_SET`` opcode, when new set created.

Python/bytecodes.c

+2
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,8 @@ dummy_func(
13021302

13031303
inst(BUILD_SET, (values[oparg] -- set)) {
13041304
set = PySet_New(NULL);
1305+
if (set == NULL)
1306+
goto error;
13051307
int err = 0;
13061308
for (int i = 0; i < oparg; i++) {
13071309
PyObject *item = values[i];

Python/generated_cases.c.h

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)