From: Zackery Spytz Date: Wed, 4 Sep 2019 13:58:05 +0000 (-0600) Subject: bpo-36030: Fix a possible segfault in PyTuple_New() (GH-15670) X-Git-Tag: v3.9.0a1~707 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=60bd1f88f21073965a444c8b39c4202d015da5d6;p=thirdparty%2FPython%2Fcpython.git bpo-36030: Fix a possible segfault in PyTuple_New() (GH-15670) --- diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 3419baa529a6..a72257f95b08 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; }