Skip to content

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
@jim-easterbrook jim-easterbrook deleted the fix_3080 branch February 11, 2025 09:38
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