From c74a10ddb4b86b87e1ea7fab611d25ba53f23bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Wed, 24 Mar 2021 10:36:51 +0100 Subject: [PATCH] Catch invalid cache source storage path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- lib/private/Files/Cache/Cache.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index a887764649450..26e23e2163911 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -612,6 +612,10 @@ public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) { $targetPath = $this->normalize($targetPath); $sourceData = $sourceCache->get($sourcePath); + if ($sourceData === false) { + throw new \Exception('Invalid source storage path: ' . $sourcePath); + } + $sourceId = $sourceData['fileid']; $newParentId = $this->getParentId($targetPath);