summaryrefslogtreecommitdiff
path: root/kde-frameworks/kio/files/kio-5.110.0-crash.patch
blob: dcda1cfe06f5325f5b13166affc5dbee2ee45baf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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