summaryrefslogtreecommitdiffstats
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
authorEclips4 <80244920+Eclips4@users.noreply.github.com>2023-02-16 17:46:43 (GMT)
committerGitHub <noreply@github.com>2023-02-16 17:46:43 (GMT)
commit68bd8c5e2efab64ff9d38a214775164182179431 (patch)
tree09bd0d5138c62ef43b51a8e8ee16ca6ca1ef3c93 /Python/bytecodes.c
parent924a3bfa28578802eb9ca77a66fb5d4762a62f14 (diff)
downloadcpython-68bd8c5e2efab64ff9d38a214775164182179431.zip
cpython-68bd8c5e2efab64ff9d38a214775164182179431.tar.gz
cpython-68bd8c5e2efab64ff9d38a214775164182179431.tar.bz2
gh-101952: Fix possible segfault in `BUILD_SET` opcode (#101958)
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index d5d5034..84747f1 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -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];