https://github.com/python/cpython/commit/97b06d543fed66d8393c46ea7d01af50ce66e4ca commit: 97b06d543fed66d8393c46ea7d01af50ce66e4ca branch: 3.13 author: Miss Islington (bot) <[email protected]> committer: sobolevn <[email protected]> date: 2024-07-14T11:48:33Z summary:
[3.13] gh-121660: Fix `ga_getitem` by explicitly checking for `NULL` result (GH-121661) (#121761) gh-121660: Fix `ga_getitem` by explicitly checking for `NULL` result (GH-121661) (cherry picked from commit bb802db8cfa35a88582be32fae05fe1cf8f237b1) Co-authored-by: sobolevn <[email protected]> files: M Objects/genericaliasobject.c diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c index 2779baf0bd1c61..3c64e75fca8a2e 100644 --- a/Objects/genericaliasobject.c +++ b/Objects/genericaliasobject.c @@ -561,6 +561,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); _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: [email protected]
