[php-src] PR #25731: Fix FFI::string() reading out of bounds for a negative size
| From: | marc-mabe | Date: | Wed, 25 Nov 2026 07:41:16 +0000 |
| Subject: | [php-src] PR #25731: Fix FFI::string() reading out of bounds for a negative size | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40988@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25731
Author: marc-mabe
FFI::string() passed a negative size on to the string allocation, where it wrapped around to a small
allocation that was then filled with nearly SIZE_MAX bytes read from the pointer. For arrays, a
negative size was rejected by the comparison with the array size only because that comparison
happens to be unsigned.
Reject a negative size with a ValueError, for pointers and arrays alike.