Fix allocation loop in zend_shared_alloc_startup()

The break is outside the if, so if it succeeds or not this will always
stop after the first loop iteration instead of trying more allocators if
the first one fails.

Closes GH-11306.
This commit is contained in:
nielsdos 2023-05-23 19:50:09 +02:00
parent b2ec6c24f8
commit 6267601f84
2 changed files with 4 additions and 1 deletions

3
NEWS
View File

@ -2,6 +2,9 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.1.21
- Opcache:
. Fix allocation loop in zend_shared_alloc_startup(). (nielsdos)
- Standard:
. Fix access on NULL pointer in array_merge_recursive(). (ilutov)
. Fix exception handling in array_multisort(). (ilutov)

View File

@ -179,8 +179,8 @@ int zend_shared_alloc_startup(size_t requested_size, size_t reserved_size)
res = zend_shared_alloc_try(he, requested_size, &ZSMMG(shared_segments), &ZSMMG(shared_segments_count), &error_in);
if (res) {
/* this model works! */
break;
}
break;
}
}
}