From 19eb48b8a3597943d5d677d8caf318392613d86b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 26 Feb 2021 11:12:20 +0100 Subject: [PATCH] Properly end iterating over the file once the target has been reached MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/private/Files/View.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 1bee09e365..ed7d6c2631 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -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;