aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2022-03-16 13:07:55 +0100
committerGitHub <noreply@github.com>2022-03-16 13:07:55 +0100
commit85733a4b2e01147a9f1803b425820383b7cc8faf (patch)
treee1428d35cde6d3f3243e83f137081f87faa3c26b
parentc8f0d0bc0ebd3a40ca609e338c195f2de0f96fd6 (diff)
parent675e596a00634c689c11b347a1d45d70865a2c4b (diff)
downloadnextcloud-server-85733a4b2e01147a9f1803b425820383b7cc8faf.tar.gz
nextcloud-server-85733a4b2e01147a9f1803b425820383b7cc8faf.zip
Merge pull request #31548 from nextcloud/backport/31531/stable22
[stable22] Prevent reading key on SFTP stat bool
-rw-r--r--apps/files_external/lib/Lib/Storage/SFTP.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php
index ae049007cdc..e46f60d0be4 100644
--- a/apps/files_external/lib/Lib/Storage/SFTP.php
+++ b/apps/files_external/lib/Lib/Storage/SFTP.php
@@ -327,6 +327,9 @@ class SFTP extends \OC\Files\Storage\Common {
public function filetype($path) {
try {
$stat = $this->getConnection()->stat($this->absPath($path));
+ if (!is_array($stat) || !array_key_exists('type', $stat)) {
+ return false;
+ }
if ((int) $stat['type'] === NET_SFTP_TYPE_REGULAR) {
return 'file';
}