Skip to content

Commit f6247aa

Browse files
Alexey Izbyshevbenjaminp
authored andcommitted
closes bpo-34477: Objects/typeobject.c: Add missing NULL check to type_init() (GH-8876)
Reported by Svace static analyzer.
1 parent cc18258 commit f6247aa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Objects/typeobject.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2295,6 +2295,9 @@ type_init(PyObject *cls, PyObject *args, PyObject *kwds)
22952295
/* Call object.__init__(self) now. */
22962296
/* XXX Could call super(type, cls).__init__() but what's the point? */
22972297
args = PyTuple_GetSlice(args, 0, 0);
2298+
if (args == NULL) {
2299+
return -1;
2300+
}
22982301
res = object_init(cls, args, NULL);
22992302
Py_DECREF(args);
23002303
return res;

0 commit comments

Comments
 (0)