Skip to content

Fix GH-19371: integer overflow in calendar.c #19380

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

Closed
wants to merge 3 commits into from

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Aug 5, 2025

No description provided.

@nielsdos nielsdos linked an issue Aug 5, 2025 that may be closed by this pull request
RETURN_THROWS();
}

if (UNEXPECTED(ZEND_LONG_EXCEEDS_INT(day))) {
Copy link
Member

@devnexen devnexen Aug 5, 2025

Choose a reason for hiding this comment

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

just curious. if you want to insist on INT32 ranges why not doing the range check "manually" here ?

Copy link
Member Author

Choose a reason for hiding this comment

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

The code does not do +1/-1 on the day, so that's fine.
ZEND_LONG_EXCEEDS_INT will also avoid a warning on 32-bit systems where zend_long==int.

Copy link
Member

Choose a reason for hiding this comment

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

ah yes I missed the former.. ok !

Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

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

having worked a bit on calendar, the changes look correct to me

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.

integer overflow in calendar.c
2 participants