Bug #81283 [Ver->Csd]: shmop can't read beyond 2147483647 bytes

From: Date: Fri, 23 Jul 2021 15:53:25 +0000
Subject: Bug #81283 [Ver->Csd]: shmop can't read beyond 2147483647 bytes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235314@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81283&edit=1 ID: 81283 Updated by: git@php.net Reported by: mr dot sol dot 7788 at gmail dot com Summary: shmop can't read beyond 2147483647 bytes -Status: Verified +Status: Closed Type: Bug Package: Unknown/Other Function Operating System: Linux PHP Version: Irrelevant Assigned To: cmb Block user comment: N Private report: N New Comment: Automatic comment on behalf of cmb69 Revision: https://github.com/php/php-src/commit/387c0de98312d576868bf45e8c7b2d4f2ab3c738 Log: Fix #81283: shmop can't read beyond 2147483647 bytes Previous Comments: ------------------------------------------------------------------------ [2021-07-23 10:45:34] cmb@php.net The following pull request has been associated: Patch Name: Fix #81283: shmop_read(): count is out of range On GitHub: https://github.com/php/php-src/pull/7301 Patch: https://github.com/php/php-src/pull/7301.patch ------------------------------------------------------------------------ [2021-07-23 10:36:04] nikic@php.net The overflow check incorrectly uses INT_MAX instead of ZEND_LONG_MAX. ------------------------------------------------------------------------ [2021-07-23 10:23:18] mr dot sol dot 7788 at gmail dot com Description: ------------ PHP 7.4.3 (cli) Zend Engine v3.4.0 Kubuntu (focal) - x86_64 PHP_INT_SIZE:8 PHP_INT_MAX:9223372036854775807 Created shared memeory with size 28991029248. Write in all diapozon is normal. Read bigest at position 2147483646 one byte. shmop_read($shmp, 2147483647, 1) getted error Warning: shmop_read(): count is out of range in Test script: --------------- <?php $KeyShm = ftok(__FILE__, 'a'); $shmp = shmop_open($KeyShm, 'n', 0644, 28991029248); $WriteRes = shmop_write($shmp, "a", 2147483647);//All ok $ReadRes1 = shmop_read($shmp, 2147483646, 1);//All ok $ReadRes2 = shmop_read($shmp, 2147483647, 1);//Error //Warning: shmop_read(): count is out of range in echo "ReadRes2:'".($ReadRes2!==false?$ReadRes2:'false')."' ".PHP_EOL; shmop_delete($shmp); shmop_close($shmp); Expected result: ---------------- ReadRes2:'a' Actual result: -------------- ReadRes2:'false' ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=81283&edit=1

« previous php.bugs (#235314) next »