Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
explicitly close source stream on encryption storage
Signed-off-by: Daniel Kesselberg <[email protected]>
  • Loading branch information
kesselb authored and backportbot[bot] committed Oct 8, 2021
commit 15417f38247ae69579e6e95c98a7d741808655b8
5 changes: 3 additions & 2 deletions lib/private/Files/Storage/Wrapper/Encryption.php
Original file line number Diff line number Diff line change
Expand Up @@ -926,10 +926,10 @@ protected function getHeader($path) {
}

$result = [];

// first check if it is an encrypted file at all
// We would do query to filecache only if we know that entry in filecache exists

$info = $this->getCache()->get($path);
if (isset($info['encrypted']) && $info['encrypted'] === true) {
$firstBlock = $this->readFirstBlock($path);
Expand Down Expand Up @@ -1033,6 +1033,7 @@ public function writeStream(string $path, $stream, int $size = null): int {
// always fall back to fopen
$target = $this->fopen($path, 'w');
[$count, $result] = \OC_Helper::streamCopy($stream, $target);
fclose($stream);
fclose($target);
return $count;
}
Expand Down