Skip to content

Commit

Permalink
Fix allocation loop in zend_shared_alloc_startup()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nielsdos committed May 24, 2023
1 parent b2ec6c2 commit 6267601
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/zend_shared_alloc.c
Expand Up @@ -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;
}
}
}
Expand Down

0 comments on commit 6267601

Please sign in to comment.