Repository navigation
Conversation
Member
|
The fix is looking good, however can you add a test case with |
hohphu8
force-pushed
the
fix-intl-datetime-decompose-uninit
branch
from
November 28, 2026 17:39
4dcfc6f to
9ebdb49
Compare
Contributor
Author
|
Added a |
LamentXU123
approved these changes
Nov 28, 2026
LamentXU123
left a comment
Member
There was a problem hiding this comment.
I will add a NEWS entry when merging.
Might have some trouble merging upwards but I can handle it.
LamentXU123
added a commit
that referenced
this pull request
Nov 28, 2026
* PHP-8.6: ext/intl: Fix crash when formatting an uninitialized DateTime (#25878)
Member
|
Thanks to LLMs we can scan and fix these stupid bugs <(_ _)>. |
opensource-fork-sync Bot
pushed a commit
to cla7aye15I4nd/opensource-php__php-src
that referenced
this pull request
Nov 28, 2026
* PHP-8.4: ext/intl: Fix crash when formatting an uninitialized DateTime (php#25878)
opensource-fork-sync Bot
pushed a commit
to cla7aye15I4nd/opensource-php__php-src
that referenced
this pull request
Nov 28, 2026
* PHP-8.5: ext/intl: Fix crash when formatting an uninitialized DateTime (php#25878)
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.
In
intl_datetime_decompose()(ext/intl/common/common_date.cpp), theif (millis)block dereferencesdatetime->time->uswithout checking whetherdatetime->timeis initialized (unlike theif (tz)block immediately below it). ADateTimesubclass that skipsparent::__construct()and overridesgetTimestamp()to return anintcauses a NULL pointer dereference when passed toIntlDateFormatter::formatObject()orIntlDateFormatter::format().Check
if (!datetime->time)before accessingdatetime->time->usand reportU_ILLEGAL_ARGUMENT_ERRORconsistently with theif (tz)branch, while preserving existinggetTimestamp()error behavior for subclasses that do not override it.Added a regression test covering both
IntlDateFormatter::formatObject()andIntlDateFormatter::format().Note: AI-assisted code audit; manually verified and reproduced locally.