ext/calendar: Fix integer overflow in GregorianToSdn() and JulianToJd()#22604
Open
arshidkv12 wants to merge 8 commits into
Open
ext/calendar: Fix integer overflow in GregorianToSdn() and JulianToJd()#22604arshidkv12 wants to merge 8 commits into
arshidkv12 wants to merge 8 commits into
Conversation
devnexen
reviewed
Jul 5, 2026
ext/calendar: Fix integer overflow in GregorianToSdn() ext/calendar: Fix integer overflow in GregorianToSdn()
9c17192 to
090a157
Compare
ext/calendar: Fix integer overflow in GregorianToSdn() ext/calendar: Fix integer overflow in GregorianToSdn()
ea879ab to
0cabaf2
Compare
LamentXU123
reviewed
Jul 5, 2026
devnexen
reviewed
Jul 6, 2026
| calendar | ||
| --FILE-- | ||
| <?php | ||
| var_dump(gregoriantojd(5, 5, PHP_INT_MAX > 2147483647 ? 2147483647 : PHP_INT_MAX)); |
Member
There was a problem hiding this comment.
can we try the negative opposite case too ?
Contributor
Author
There was a problem hiding this comment.
Ok. I added the negative case too.
devnexen
approved these changes
Jul 6, 2026
LamentXU123
reviewed
Jul 6, 2026
Contributor
Author
Ok |
LamentXU123
reviewed
Jul 6, 2026
LamentXU123
left a comment
Member
There was a problem hiding this comment.
You may also need a NEWS entry :)
| @@ -0,0 +1,20 @@ | |||
| --TEST-- | |||
| Bug GH-22602: (gregoriantojd() integer overflow with INT_MAX year) | |||
Member
There was a problem hiding this comment.
Suggested change
| Bug GH-22602: (gregoriantojd() integer overflow with INT_MAX year) | |
| Bug GH-22602: (gregoriantojd() and juliantojd() integer overflow with INT_MAX year) |
ext/calendar: Fix integer overflow in GregorianToSdn() ext/calendar: Fix integer overflow in GregorianToSdn()
90bd2d7 to
fefe297
Compare
devnexen
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#22603