Skip to content

Commit

Permalink
pythongh-121660: Fix ga_getitem by explicitly checking for NULL r…
Browse files Browse the repository at this point in the history
…esult
  • Loading branch information
sobolevn committed Jul 13, 2024
1 parent e6264b4 commit b511efc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Objects/genericaliasobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,10 @@ ga_getitem(PyObject *self, PyObject *item)
}

PyObject *res = Py_GenericAlias(alias->origin, newargs);
if (res == NULL) {
Py_DECREF(newargs);
return NULL;
}
((gaobject *)res)->starred = alias->starred;

Py_DECREF(newargs);
Expand Down

0 comments on commit b511efc

Please sign in to comment.