mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Fix GH-8235: iterator_count() may run indefinitely
This commit is contained in:
commit
e004e1a93b
2 changed files with 6 additions and 0 deletions
3
NEWS
3
NEWS
|
@ -5,6 +5,9 @@ PHP NEWS
|
|||
- FPM:
|
||||
. Fixed ACL build check on MacOS. (David Carlier)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug GH-8235 (iterator_count() may run indefinitely). (cmb)
|
||||
|
||||
- Zip:
|
||||
. Fixed type for index in ZipArchive::replaceFile. (Martin Rehberger)
|
||||
|
||||
|
|
|
@ -3127,6 +3127,9 @@ PHP_FUNCTION(iterator_to_array)
|
|||
|
||||
static int spl_iterator_count_apply(zend_object_iterator *iter, void *puser) /* {{{ */
|
||||
{
|
||||
if (UNEXPECTED(*(zend_long*)puser == ZEND_LONG_MAX)) {
|
||||
return ZEND_HASH_APPLY_STOP;
|
||||
}
|
||||
(*(zend_long*)puser)++;
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue