summaryrefslogtreecommitdiffstats
path: root/Objects/tupleobject.c
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2019-09-04 13:58:05 (GMT)
committerVictor Stinner <vstinner@redhat.com>2019-09-04 13:58:04 (GMT)
commit60bd1f88f21073965a444c8b39c4202d015da5d6 (patch)
tree2752030cc7c37535139644e4722d5b56418cd4fd /Objects/tupleobject.c
parent675d17cec49ed7f7eb01d1bc3ae6999c728e070d (diff)
downloadcpython-60bd1f88f21073965a444c8b39c4202d015da5d6.zip
cpython-60bd1f88f21073965a444c8b39c4202d015da5d6.tar.gz
cpython-60bd1f88f21073965a444c8b39c4202d015da5d6.tar.bz2
bpo-36030: Fix a possible segfault in PyTuple_New() (GH-15670)
Diffstat (limited to 'Objects/tupleobject.c')
-rw-r--r--Objects/tupleobject.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 3419baa..a72257f 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -146,6 +146,9 @@ PyTuple_New(Py_ssize_t size)
}
#endif
op = tuple_alloc(size);
+ if (op == NULL) {
+ return NULL;
+ }
for (Py_ssize_t i = 0; i < size; i++) {
op->ob_item[i] = NULL;
}