diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-04-20 17:30:10 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-04-20 18:32:40 +0200 |
commit | 76dad297ffc4084d2057e2c2312f0c53f1e15f5b (patch) | |
tree | bc80e8b29b01c02cbe7b94dc671e16fec62eed61 /lib | |
parent | 3e8f6cdba95690a12de4f8d6b99c59f7a823fbb0 (diff) | |
download | nextcloud-server-76dad297ffc4084d2057e2c2312f0c53f1e15f5b.tar.gz nextcloud-server-76dad297ffc4084d2057e2c2312f0c53f1e15f5b.zip |
Fix encryption feof to not return too early
This is because stream_read will pre-cache the next block which causes
feof($this->source) to return true prematurely. So we cannot rely on it.
Fixed encryption stream wrapper unit tests to actually simulate 6k/8k
blocks to make sure we cover the matching logic.
Added two data files with 8192 and 8193 bytes.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/stream/encryption.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/files/stream/encryption.php b/lib/private/files/stream/encryption.php index 4a1df840105..083f8af9e50 100644 --- a/lib/private/files/stream/encryption.php +++ b/lib/private/files/stream/encryption.php @@ -243,6 +243,10 @@ class Encryption extends Wrapper { } + public function stream_eof() { + return $this->position >= $this->unencryptedSize; + } + public function stream_read($count) { $result = ''; |