Skip to content

Conversation

devnexen
Copy link
Member

No description provided.

@devnexen devnexen linked an issue Nov 17, 2024 that may be closed by this pull request
@devnexen devnexen changed the title Fix GH-16384: cal_from_jd overflow on julian_day argument. Fix GH-16834: cal_from_jd overflow on julian_day argument. Nov 17, 2024
@devnexen devnexen marked this pull request as ready for review November 17, 2024 09:25
/* Calculate the century (year/100). */
century = temp / DAYS_PER_400_YEARS;

if (century > ((INT_MAX / 100) - (temp / DAYS_PER_4_YEARS))) {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this check be after the reassignment of temp? temp itself can't overflow I think?

Copy link
Member Author

Choose a reason for hiding this comment

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

true I missed that line.

@devnexen devnexen closed this in 80894d8 Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Signed integer overflow in cal_from_jd

2 participants