[php-src] PR #15989: Fix GH-15980: Signed integer overflow in main/streams/streams.c
| From: | cmb69 | Date: | Sun, 22 Sep 2024 18:41:04 +0000 |
| Subject: | [php-src] PR #15989: Fix GH-15980: Signed integer overflow in main/streams/streams.c | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-28707@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/15989
Author: cmb69
We need to avoid signed integer overflows which are undefined behavior. We catch that, and set
offset to ZEND_LONG_MAX (which is also the largest value of
zend_off_t on all platforms). Of course, after such a seek a stream is no longer
readable, but that matches the current behavior for offsets near ZEND_LONG_MAX.