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 3080 #3081

Merged
merged 2 commits into from
Dec 5, 2024
Merged

Fix 3080 #3081

merged 2 commits into from
Dec 5, 2024

Conversation

jim-easterbrook
Copy link
Contributor

Add overflow checking to DateValue toRational method. Sets ok_ to false if the result is invalid.

The "seconds since UNIX epoch" overflows a Rational (int32) in 2038. See
Exiv2#3080 for background.
This is the correct way to indicate that the value conversion failed.
Copy link
Collaborator

@kmilos kmilos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@kmilos kmilos linked an issue Dec 5, 2024 that may be closed by this pull request
@kmilos kmilos added the forward-to-main Forward changes in a 0.28.x PR to main with Mergify label Dec 5, 2024
@kmilos kmilos added this to the v0.28.4 milestone Dec 5, 2024
@kmilos kmilos merged commit c7a0b78 into Exiv2:0.28.x Dec 5, 2024
57 checks passed
@mergify mergify bot mentioned this pull request Dec 5, 2024
@kmilos kmilos added the bug label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug forward-to-main Forward changes in a 0.28.x PR to main with Mergify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DateValue.toRational() fails in year 2038
2 participants