Skip to content

Commit 6267601

Browse files
committed
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.
1 parent b2ec6c2 commit 6267601

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.1.21
44

5+
- Opcache:
6+
. Fix allocation loop in zend_shared_alloc_startup(). (nielsdos)
7+
58
- Standard:
69
. Fix access on NULL pointer in array_merge_recursive(). (ilutov)
710
. Fix exception handling in array_multisort(). (ilutov)

ext/opcache/zend_shared_alloc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ int zend_shared_alloc_startup(size_t requested_size, size_t reserved_size)
179179
res = zend_shared_alloc_try(he, requested_size, &ZSMMG(shared_segments), &ZSMMG(shared_segments_count), &error_in);
180180
if (res) {
181181
/* this model works! */
182+
break;
182183
}
183-
break;
184184
}
185185
}
186186
}

0 commit comments

Comments
 (0)