Skip to content

Commit 111bd5d

Browse files
committed
Introduced additional check. Its miss might be the reason of bug #70392 (SIGSEGV during PHP shutdown)
1 parent a2f8a76 commit 111bd5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Zend/zend_alloc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ static void *zend_mm_alloc_pages(zend_mm_heap *heap, int pages_count ZEND_FILE_L
964964
/* skip free blocks */
965965
while (tmp == 0) {
966966
i += ZEND_MM_BITSET_LEN;
967-
if (i >= free_tail) {
967+
if (i >= free_tail || i == ZEND_MM_PAGES) {
968968
len = ZEND_MM_PAGES - page_num;
969969
if (len >= pages_count && len < best_len) {
970970
chunk->free_tail = page_num + pages_count;

0 commit comments

Comments
 (0)