aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2021-03-01 09:54:33 +0100
committerGitHub <noreply@github.com>2021-03-01 09:54:33 +0100
commit91f260fe29239e62fc473a645c30502431d505f7 (patch)
treebeceb8149d7764ff0e44df444ba5fc97fff58674 /lib
parent9a90bfba32db3ceea69a8aa5a5d0a4b277ebabd9 (diff)
parent19eb48b8a3597943d5d677d8caf318392613d86b (diff)
downloadnextcloud-server-91f260fe29239e62fc473a645c30502431d505f7.tar.gz
nextcloud-server-91f260fe29239e62fc473a645c30502431d505f7.zip
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
Diffstat (limited to 'lib')
-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;