[php-src] PR #22425: Fix int truncation of read length in shmop_read()

From: Date: Wed, 24 Jun 2026 11:22:10 +0000
Subject: [php-src] PR #22425: Fix int truncation of read length in shmop_read()
Groups: php.git-pulls 
Request: Send a blank email to git-pulls+get-36591@lists.php.net to get a copy of this message
Pull Request: https://github.com/php/php-src/pull/22425 Author: iliaal shmop_read() held the read length in an int while count and shmop->size are zend_long and the bounds checks validate against the full 64-bit size. On a shared-memory segment larger than INT_MAX, a length that sets the int sign bit was sign-extended into the size_t argument of zend_string_init(), requesting a near-SIZE_MAX allocation; other truncated lengths returned a wrong-sized string. Hold the length in a zend_long, matching the zend_long writesize already used in shmop_write(). Triggering needs a >2GB segment, so there is no portable red/green test; the fix is a type correction with no behavioral change below INT_MAX.

« previous php.git-pulls (#36591) next »