Skip to content

Fix ZEND_LONG_UINT_OVFL() accepting negative values on 32-bit platforms - #24778

Open
marc-mabe wants to merge 1 commit into
php:PHP-8.4from
marc-mabe:fix-zend-long-uint-ovfl-32bit-8.4
Open

marc-mabe wants to merge 1 commit into
php:PHP-8.4from
marc-mabe:fix-zend-long-uint-ovfl-32bit-8.4

Conversation

@marc-mabe

Copy link
Copy Markdown
Contributor

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().

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().
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.

1 participant