Skip to content
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

Fix undefined behavior shift in MD5 #57

Merged
merged 1 commit into from
Dec 15, 2022
Merged

Fix undefined behavior shift in MD5 #57

merged 1 commit into from
Dec 15, 2022

Conversation

skeeto
Copy link
Contributor

@skeeto skeeto commented Dec 12, 2022

The "unsigned char" read from "data" is promoted to "int" and the left shift by 24 sometimes results in signed overflow. UBSan reveals this error when running the tests.

I also reported this issue upstream, but it looks abandoned and is likely to ever see a fix: B-Con/crypto-algorithms#33

The "unsigned char" read from "data" is promoted to "int" and the left
shift by 24 sometimes results in signed overflow. UBSan reveals this
error when running the tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Signed overflow undefined behavior in md5.c
2 participants