[php-src] master: Merge branch 'PHP-8.4' into PHP-8.5

Ilia Alshanetsky <[email protected]> Fri, 24 Jul 2026 15:54:18 +0000
Newsgroups gmane.comp.php.cvs.general
Message-ID <[email protected]>
Author: Ilia Alshanetsky (iliaal)
Date: 2026-07-24T11:47:34-04:00

Commit: https://github.com/php/php-src/commit/aa01328a23df06b7c16af3a5ffce32d997c37495
Raw diff: https://github.com/php/php-src/commit/aa01328a23df06b7c16af3a5ffce32d997c37495.diff

Merge branch 'PHP-8.4' into PHP-8.5

* PHP-8.4:
  Fix OOB read in opcache POSIX largepage page-size selection

Changed paths:
  M  ext/opcache/shared_alloc_posix.c


Diff:

diff --git a/ext/opcache/shared_alloc_posix.c b/ext/opcache/shared_alloc_posix.c
index 3f1e097fe97c..aa474729594b 100644
--- a/ext/opcache/shared_alloc_posix.c
+++ b/ext/opcache/shared_alloc_posix.c
@@ -51,9 +51,10 @@ static int create_segments(size_t requested_size, zend_shared_segment_posix ***s
 	 * only then amd64/i386/arm64 and perharps risc64*
 	 * archs are on interest here.
 	 */
-	size_t i, shared_segment_sizes = 0, shared_segment_lg_index = 0;
+	size_t shared_segment_lg_index = 0;
 	size_t shared_segment_sindexes[3] = {0};
 	const size_t entries = sizeof(shared_segment_sindexes) / sizeof(shared_segment_sindexes[0]);
+	int i, shared_segment_sizes;
 
 	shared_segment_sizes = getpagesizes(shared_segment_sindexes, entries);