Skip to content

Commit fbe359a

Browse files
miss-islingtonAlexey Izbyshev
andauthored
closes bpo-34477: Objects/typeobject.c: Add missing NULL check to type_init() (GH-8876)
Reported by Svace static analyzer. (cherry picked from commit f6247aa) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
1 parent 945771b commit fbe359a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Objects/typeobject.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,6 +2235,9 @@ type_init(PyObject *cls, PyObject *args, PyObject *kwds)
22352235
/* Call object.__init__(self) now. */
22362236
/* XXX Could call super(type, cls).__init__() but what's the point? */
22372237
args = PyTuple_GetSlice(args, 0, 0);
2238+
if (args == NULL) {
2239+
return -1;
2240+
}
22382241
res = object_init(cls, args, NULL);
22392242
Py_DECREF(args);
22402243
return res;

0 commit comments

Comments
 (0)