summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorAlexey Izbyshev <izbyshev@ispras.ru>2018-08-24 04:22:16 (GMT)
committerBenjamin Peterson <benjamin@python.org>2018-08-24 04:22:16 (GMT)
commitf6247aac08c1a79d0479145a405718bb76dba434 (patch)
tree592499652ac804f9ff7bf3b40ffc630f139913f6 /Objects
parentcc18258daf2727a4b8d657aaf0bf8a9cb0b54bb3 (diff)
downloadcpython-f6247aac08c1a79d0479145a405718bb76dba434.zip
cpython-f6247aac08c1a79d0479145a405718bb76dba434.tar.gz
cpython-f6247aac08c1a79d0479145a405718bb76dba434.tar.bz2
closes bpo-34477: Objects/typeobject.c: Add missing NULL check to type_init() (GH-8876)
Reported by Svace static analyzer.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index a7a9d7b..af9685d 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2295,6 +2295,9 @@ type_init(PyObject *cls, PyObject *args, PyObject *kwds)
/* Call object.__init__(self) now. */
/* XXX Could call super(type, cls).__init__() but what's the point? */
args = PyTuple_GetSlice(args, 0, 0);
+ if (args == NULL) {
+ return -1;
+ }
res = object_init(cls, args, NULL);
Py_DECREF(args);
return res;