Skip to content

Commit 91f260f

Browse files
authored
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
2 parents 9a90bfb + 19eb48b commit 91f260f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/private/Files/View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ public function readfilePart($path, $from, $to) {
456456
// forward file handle via chunked fread because fseek seem to have failed
457457

458458
$end = $from + 1;
459-
while (!feof($handle) && ftell($handle) < $end) {
459+
while (!feof($handle) && ftell($handle) < $end && ftell($handle) !== $from) {
460460
$len = $from - ftell($handle);
461461
if ($len > $chunkSize) {
462462
$len = $chunkSize;

0 commit comments

Comments
 (0)