[php-src] PR #25698: Fix FFI array types whose size overflows size_t
| From: | marc-mabe | Date: | Tue, 24 Nov 2026 09:29:27 +0000 |
| Subject: | [php-src] PR #25698: Fix FFI array types whose size overflows size_t | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40945@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25698
Author: marc-mabe
The size of an array type was computed as length * element size without an overflow check, in
FFI::arrayType() as well as for array declarators and nested declarators. A length that is valid on
its own could wrap the size around to a few bytes, so FFI::new() allocated a tiny buffer while
element access, which is only checked against the length, reached far beyond it.