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

Cast day/month/year elements to uint32_t #343

Merged
merged 2 commits into from
Nov 9, 2018
Merged

Cast day/month/year elements to uint32_t #343

merged 2 commits into from
Nov 9, 2018

Conversation

akmistry
Copy link
Contributor

@akmistry akmistry commented Nov 8, 2018

If the sum of day/month/year elements exceeds 32767, ubsan will tag it as undefined behaviour since the tm struct elements are int which is only defined to be at least 16-bits and signed. Casting these elements to uint32_t guarantees the calculations will be defined.

If the sum of day/month/year elements exceeds 32767, ubsan will tag it as undefined behaviour since the tm struct elements are int which is only defined to be at least 16-bits and signed. Casting these elements to uint32_t guarantees the calculations will be defined.
@akmistry
Copy link
Contributor Author

akmistry commented Nov 9, 2018

Sorry, I'm still trying to figure out github's confusing UI.

@nmoinvaz nmoinvaz merged commit f9b4d20 into zlib-ng:dev Nov 9, 2018
@nmoinvaz
Copy link
Member

nmoinvaz commented Nov 9, 2018

Looks good. Thanks!

@akmistry akmistry deleted the akmistry-patch-2 branch November 9, 2018 02:26
nmoinvaz added a commit that referenced this pull request Feb 20, 2019
…to clusterfuzz findings which is still needed. #343
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.

None yet

2 participants