summaryrefslogtreecommitdiffstats
path: root/lib/private/files/stream
diff options
context:
space:
mode:
authorjknockaert <jasper@knockaert.nl>2015-04-02 16:17:25 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-07 13:30:31 +0200
commitff16e3dbff4031bd1d3e7340ac0b53f22c60ac44 (patch)
treea017b50df55ea8075c1aa2e2bfb58567680d0438 /lib/private/files/stream
parent3e3226da4c6bb120f16e58f07c2f8c6ad17a2350 (diff)
downloadnextcloud-server-ff16e3dbff4031bd1d3e7340ac0b53f22c60ac44.tar.gz
nextcloud-server-ff16e3dbff4031bd1d3e7340ac0b53f22c60ac44.zip
Adjusting count on read
Diffstat (limited to 'lib/private/files/stream')
-rw-r--r--lib/private/files/stream/encryption.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/files/stream/encryption.php b/lib/private/files/stream/encryption.php
index fdfe73d99c5..9ef666d78ed 100644
--- a/lib/private/files/stream/encryption.php
+++ b/lib/private/files/stream/encryption.php
@@ -249,9 +249,10 @@ class Encryption extends Wrapper {
// skip the header if we read the file from the beginning
if ($this->position === 0) {
- parent::stream_read($this->util->getBlockSize());
+ parent::stream_read($this->util->getHeaderSize());
}
+ $count = min($count, $this->unencryptedSize - $this->position);
while ($count > 0) {
$remainingLength = $count;
// update the cache of the current block