Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2021-02-26 13:12:20 +0300
committerJulius Härtl <jus@bitgrid.net>2021-02-26 13:29:01 +0300
commit19eb48b8a3597943d5d677d8caf318392613d86b (patch)
tree60202992237ecf5062a9f8553170449005674e32 /lib/private/Files/View.php
parentce082dd49bc6c1b2ea7a81d4054ade7b1fa961d4 (diff)
Properly end iterating over the file once the target has been reached
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/Files/View.php')
-rw-r--r--lib/private/Files/View.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index 1bee09e3659..ed7d6c26318 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;