Skip to content

Commit 685da02

Browse files
committed
fix UBSan failures for bytesobject.c
1 parent 49234c0 commit 685da02

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Objects/bytesobject.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,15 +2648,16 @@ bytes_hex_impl(PyBytesObject *self, PyObject *sep, int bytes_per_sep)
26482648
}
26492649

26502650
static PyObject *
2651-
bytes_getnewargs(PyBytesObject *v, PyObject *Py_UNUSED(ignored))
2651+
bytes_getnewargs(PyObject *op, PyObject *Py_UNUSED(dummy))
26522652
{
2653+
PyBytesObject *v = _PyBytes_CAST(op);
26532654
return Py_BuildValue("(y#)", v->ob_sval, Py_SIZE(v));
26542655
}
26552656

26562657

26572658
static PyMethodDef
26582659
bytes_methods[] = {
2659-
{"__getnewargs__", (PyCFunction)bytes_getnewargs, METH_NOARGS},
2660+
{"__getnewargs__", bytes_getnewargs, METH_NOARGS},
26602661
BYTES___BYTES___METHODDEF
26612662
{"capitalize", stringlib_capitalize, METH_NOARGS,
26622663
_Py_capitalize__doc__},

0 commit comments

Comments
 (0)