commit | 60bd1f88f21073965a444c8b39c4202d015da5d6 | [log] [tgz] |
---|---|---|
author | Zackery Spytz <zspytz@gmail.com> | Wed Sep 04 07:58:05 2019 -0600 |
committer | Victor Stinner <vstinner@redhat.com> | Wed Sep 04 15:58:04 2019 +0200 |
tree | 2752030cc7c37535139644e4722d5b56418cd4fd | |
parent | 675d17cec49ed7f7eb01d1bc3ae6999c728e070d [diff] [blame] |
bpo-36030: Fix a possible segfault in PyTuple_New() (GH-15670)
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 @@ } #endif op = tuple_alloc(size); + if (op == NULL) { + return NULL; + } for (Py_ssize_t i = 0; i < size; i++) { op->ob_item[i] = NULL; }