Merge pull request #25804 from nextcloud/bugfix/noid/fread-0

Do not attempt to read 0 bytes when manually iterating over a non-seekable file
This commit is contained in:
Roeland Jago Douma 2021-03-01 09:54:33 +01:00 committed by GitHub
commit 91f260fe29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -456,7 +456,7 @@ class View {
// forward file handle via chunked fread because fseek seem to have failed
$end = $from + 1;
while (!feof($handle) && ftell($handle) < $end) {
while (!feof($handle) && ftell($handle) < $end && ftell($handle) !== $from) {
$len = $from - ftell($handle);
if ($len > $chunkSize) {
$len = $chunkSize;