]> source.dussan.org Git - nextcloud-server.git/commitdiff
Properly end iterating over the file once the target has been reached 26376/head
authorJulius Härtl <jus@bitgrid.net>
Fri, 26 Feb 2021 10:12:20 +0000 (11:12 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 30 Mar 2021 19:22:47 +0000 (19:22 +0000)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
lib/private/Files/View.php

index 1bee09e36590dd1941028e0d39a1e63d9319005f..ed7d6c26318bab32ff1411c38e5c101027e8a779 100644 (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;