[php-src] PR #13948: FIX file_get_contents() on Windows fails with "errno=22 Invalid argument"
| From: | DnwK98 | Date: | Fri, 12 Apr 2024 11:51:25 +0000 |
| Subject: | [php-src] PR #13948: FIX file_get_contents() on Windows fails with "errno=22 Invalid argument" | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-25725@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/13948
Author: DnwK98
I encountered a problem when attempting to load a large file using file_get_contents(), but only on
Windows.
Attempting to load a large file resulted in the following error (or notice, depending on the PHP
version):
```
Read of 3866046082 bytes failed with errno=22 Invalid argument
```
I did some research and found bug which was quite similar, but for
file_put_contents()
Old bug: https://github.com/php/php-src/pull/13205
This issue is likely due to an integer overflow on Windows, which probably is treated as negative
number which is invalid argument.