Skip to content

Fix IntlDateFormatter parse functions truncating an $offset below INT… - #24781

Closed
marc-mabe wants to merge 1 commit into
php:PHP-8.4from
marc-mabe:fix-intl-datefmt-offset-below-int-min
Closed

marc-mabe wants to merge 1 commit into
php:PHP-8.4from
marc-mabe:fix-intl-datefmt-offset-below-int-min

Conversation

@marc-mabe

Copy link
Copy Markdown
Contributor

Only the upper bound of $offset was checked before it is narrowed into an int32_t, so on 64-bit platforms e.g. -4294967295 was truncated to 1 and parsing started from there instead of failing.

This is split from #23688

…_MIN

Only the upper bound of $offset was checked before it is narrowed into an
int32_t, so on 64-bit platforms e.g. -4294967295 was truncated to 1 and
parsing started from there instead of failing.

@LamentXU123 LamentXU123 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure but I think it might be a common bug pattern to use ZEND_LONG_INT_OVFL for int32_t but not unsigned. Perhaps a good news for fuzzers?
LGTM.

LamentXU123 added a commit that referenced this pull request Oct 28, 2026
* PHP-8.6:
  Merge branch 'PHP-8.5' into PHP-8.6
  Fix IntlDateFormatter parse functions truncating an $offset below INT_MIN (#24781)
@LamentXU123

Copy link
Copy Markdown
Member

Thank you very much!

opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-php__php-src that referenced this pull request Oct 28, 2026
* PHP-8.4:
  Fix IntlDateFormatter parse functions truncating an $offset below INT_MIN (php#24781)
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-php__php-src that referenced this pull request Oct 28, 2026
* PHP-8.5:
  Merge branch 'PHP-8.4' into PHP-8.5
  Fix IntlDateFormatter parse functions truncating an $offset below INT_MIN (php#24781)
@marc-mabe
marc-mabe deleted the fix-intl-datefmt-offset-below-int-min branch October 28, 2026 12:26
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.

2 participants