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

Ilia Alshanetsky <[email protected]>
Newsgroups gmane.comp.php.cvs.general
Message-ID <[email protected]>
Author: Ilia Alshanetsky (iliaal)
Date: 2026-06-26T14:25:16-04:00

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

Merge branch 'PHP-8.4' into PHP-8.5

* PHP-8.4:
  Fix int truncation of read length in shmop_read()

Changed paths:
  M  ext/shmop/shmop.c


Diff:

diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c
index 67f060f3c82c..640f595ea6e8 100644
--- a/ext/shmop/shmop.c
+++ b/ext/shmop/shmop.c
@@ -224,7 +224,6 @@ PHP_FUNCTION(shmop_read)
 	zend_long start, count;
 	php_shmop *shmop;
 	char *startaddr;
-	int bytes;
 	zend_string *return_string;
 
 	if (zend_parse_parameters(ZEND_NUM_ARGS(), "Oll", &shmid, shmop_ce, &start, &count) == FAILURE) {
@@ -244,7 +243,7 @@ PHP_FUNCTION(shmop_read)
 	}
 
 	startaddr = shmop->addr + start;
-	bytes = count ? count : shmop->size - start;
+	zend_long bytes = count ? count : shmop->size - start;
 
 	return_string = zend_string_init(startaddr, bytes, 0);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.