gh-96821: Fix undefined behaviour in _testcapimodule.c
(GH-96915)
* gh-96821: Assert for demonstrating undefined behaviour * Fix UB Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
This commit is contained in:
parent
bbc24b2bd5
commit
cbdeda8ce7
@ -0,0 +1 @@
|
|||||||
|
Fix undefined behaviour in ``_testcapimodule.c``.
|
@ -4918,8 +4918,10 @@ meth_fastcall_keywords(PyObject* self, PyObject* const* args,
|
|||||||
if (pyargs == NULL) {
|
if (pyargs == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
assert(args != NULL || nargs == 0);
|
||||||
|
PyObject* const* args_offset = args == NULL ? NULL : args + nargs;
|
||||||
PyObject *pykwargs = PyObject_Vectorcall((PyObject*)&PyDict_Type,
|
PyObject *pykwargs = PyObject_Vectorcall((PyObject*)&PyDict_Type,
|
||||||
args + nargs, 0, kwargs);
|
args_offset, 0, kwargs);
|
||||||
return Py_BuildValue("NNN", _null_to_none(self), pyargs, pykwargs);
|
return Py_BuildValue("NNN", _null_to_none(self), pyargs, pykwargs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user