git » kio.git » main » tree

[main] / 48322f44.patch

From 48322f44323a1fc09305d66d9093fe6c3780709e Mon Sep 17 00:00:00 2001
From: Kevin Ottens <kevin.ottens@enioka.com>
Date: Fri, 15 Sep 2023 09:45:58 +0200
Subject: [PATCH] Don't crash if KMountPoint gives nothing back while checking
 for CIFS

BUG: 474451
---
 src/ioslaves/file/file_unix.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/ioslaves/file/file_unix.cpp b/src/ioslaves/file/file_unix.cpp
index 87c47e7e74..c0bc64354d 100644
--- a/src/ioslaves/file/file_unix.cpp
+++ b/src/ioslaves/file/file_unix.cpp
@@ -328,6 +328,9 @@ inline static time_t stat_mtime(const QT_STATBUF &buf)
 static bool isOnCifsMount(const QString &filePath)
 {
     const auto mount = KMountPoint::currentMountPoints().findByPath(filePath);
+    if (!mount) {
+        return false;
+    }
     return mount->mountType() == QStringLiteral("cifs") || mount->mountType() == QStringLiteral("smb3");
 }
 
-- 
GitLab