Skip to content

Add test for Phar::buildFromIterator() with a negative getMTime() - #24779

Merged
arnaud-lb merged 3 commits into
php:PHP-8.6from
marc-mabe:fix-zend-long-uint-ovfl-32bit-8.6
Nov 2, 2026
Merged

arnaud-lb merged 3 commits into
php:PHP-8.6from
marc-mabe:fix-zend-long-uint-ovfl-32bit-8.6

Conversation

@marc-mabe

Copy link
Copy Markdown
Contributor

The fix of #24778 also makes Phar::buildFromIterator() reject a negative timestamp there targeting 8.6

This is based on #24778 (cherry-picked)
This is split from #23688

Where zend_long is not wider than an int, ZEND_LONG_UINT_OVFL() was
defined as 0, so a negative value passed the check there, while it is
rejected where zend_long is wider. Keep checking the lower bound on these
platforms too.

This affects mbstring.regex_stack_limit, mbstring.regex_retry_limit and
the codepage of sapi_windows_cp_set() and sapi_windows_cp_conv().
The fix of ZEND_LONG_UINT_OVFL() on 32-bit platforms also makes
Phar::buildFromIterator() reject a negative timestamp there.
* PHP-8.6: (158 commits)
  Fix ZEND_LONG_UINT_OVFL() accepting negative values on 32-bit platforms (php#24778)
  Don't use static closure cache when called_scope diverges
  ext/com_dotnet: Fix phpGH-25008 event source typelib crash
  Fix phpGH-25093: Phar::webPhar() redirect reads past the request URI (php#25102)
  Fix the WSAPoll backend of Io\Poll accepting handles that are not sockets
  Fix phpGH-25086: Io\Poll kqueue backend leaks memory on every modifyEvents() (php#25087)
  openssl: Fix heap buffer overflow in TLS PSK callbacks
  openssl: Fix use-after-free in TLS session remove callback
  [`%pS` migration] Use `%pS` in ext/standard/var.c
  [`%pS` migration] Use `%pS` in ext/standard/var_unserializer.re
  [`%pS` migration] Use `%pS` in ext/standard/string.c
  [`%pS` migration] Use `%pS` in ext/standard/streamsfuncs.c
  [`%pS` migration] Use `%pS` in ext/standard/proc_open.c
  [`%pS` migration] Use `%pS` in ext/standard/mail.c
  [`%pS` migration] Use `%pS` in ext/standard/info.c
  [`%pS` migration] Use `%pS` in ext/standard/http.c
  [`%pS` migration] Use `%pS` in ext/standard/http_fopen_wrapper.c
  [`%pS` migration] Use `%pS` in ext/standard/head.c
  [`%pS` migration] Use `%pS` in ext/standard/ftp_fopen_wrapper.c
  [`%pS` migration] Use `%pS` in ext/standard/fsock.c
  ...
@arnaud-lb
arnaud-lb merged commit eee2856 into php:PHP-8.6 Nov 2, 2026
1 check passed
arnaud-lb added a commit that referenced this pull request Nov 2, 2026
* PHP-8.6:
  Add test for Phar::buildFromIterator() with a negative getMTime() (#24779)
@arnaud-lb

Copy link
Copy Markdown
Member

Thank you!

@marc-mabe
marc-mabe deleted the fix-zend-long-uint-ovfl-32bit-8.6 branch November 3, 2026 08:47
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