Skip to content

Commit

Permalink
closes bpo-34477: Objects/typeobject.c: Add missing NULL check to typ…
Browse files Browse the repository at this point in the history
…e_init() (GH-8876)

Reported by Svace static analyzer.
(cherry picked from commit f6247aa)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
  • Loading branch information
miss-islington and izbyshev committed Aug 24, 2018
1 parent 945771b commit fbe359a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Objects/typeobject.c
Expand Up @@ -2235,6 +2235,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;
Expand Down

0 comments on commit fbe359a

Please sign in to comment.