From b77b1d6bbdd233b4cff7d7667b95a834195c30ce Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Tue, 21 Sep 2021 17:40:19 +0200 Subject: [PATCH] explicitly close source stream on encryption storage Signed-off-by: Daniel Kesselberg --- lib/private/Files/Storage/Wrapper/Encryption.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php index 64c9b0a4a66..125338a290d 100644 --- a/lib/private/Files/Storage/Wrapper/Encryption.php +++ b/lib/private/Files/Storage/Wrapper/Encryption.php @@ -926,10 +926,10 @@ class Encryption extends Wrapper { } $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); @@ -1033,6 +1033,7 @@ class Encryption extends Wrapper { // always fall back to fopen $target = $this->fopen($path, 'w'); [$count, $result] = \OC_Helper::streamCopy($stream, $target); + fclose($stream); fclose($target); return $count; }