Skip to content

gh-111178: fix UBSan failures in Modules/_hashopenssl.c #129802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Feb 26, 2025
Prev Previous commit
Next Next commit
fix a bad representation!
  • Loading branch information
picnixz committed Feb 25, 2025
commit 26faaa59b44e07ab6e5eb227e505ddf08aacf5f7
5 changes: 3 additions & 2 deletions Modules/_hashopenssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1706,9 +1706,10 @@ _hmac_dealloc(PyObject *op)
}

static PyObject *
_hmac_repr(PyObject *self)
_hmac_repr(PyObject *op)
{
PyObject *digest_name = _hashlib_hmac_get_name(self, NULL);
HMACobject *self = HMACobject_CAST(op);
PyObject *digest_name = py_digest_name(HMAC_CTX_get_md(self->ctx));
if (digest_name == NULL) {
return NULL;
}
Expand Down