mirror of
https://github.com/python/cpython.git
synced 2026-05-06 04:37:33 -04:00
[3.14] gh-148222: Fix NULL dereference bugs in genericaliasobject.c (GH-148226) (#148705)
gh-148222: Fix NULL dereference bugs in genericaliasobject.c (GH-148226)
(cherry picked from commit 634568d030)
Co-authored-by: Prakash Sellathurai <prakashsellathurai@gmail.com>
This commit is contained in:
committed by
GitHub
parent
7f6a0c377b
commit
67100b3e92
@@ -0,0 +1 @@
|
||||
Fix vectorcall support in :class:`types.GenericAlias` when the underlying type does not support the vectorcall protocol. Fix possible leaks in :class:`types.GenericAlias` and :class:`types.UnionType` in case of memory error.
|
||||
@@ -242,7 +242,6 @@ _Py_make_parameters(PyObject *args)
|
||||
len += needed;
|
||||
if (_PyTuple_Resize(¶meters, len) < 0) {
|
||||
Py_DECREF(subparams);
|
||||
Py_DECREF(parameters);
|
||||
Py_XDECREF(tuple_args);
|
||||
return NULL;
|
||||
}
|
||||
@@ -647,7 +646,7 @@ ga_vectorcall(PyObject *self, PyObject *const *args,
|
||||
size_t nargsf, PyObject *kwnames)
|
||||
{
|
||||
gaobject *alias = (gaobject *) self;
|
||||
PyObject *obj = PyVectorcall_Function(alias->origin)(alias->origin, args, nargsf, kwnames);
|
||||
PyObject *obj = PyObject_Vectorcall(alias->origin, args, nargsf, kwnames);
|
||||
return set_orig_class(obj, self);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user