Add null check for resultDacl after calling GetSecurityDescriptorDacl
authorFabian Creutz <fabian.creutz@kaskadee.eu>
Sun, 10 Nov 2024 20:48:28 +0000 (21:48 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Fri, 15 Nov 2024 08:28:05 +0000 (09:28 +0100)
Signed-off-by: Fabian Creutz <fabian.creutz@kaskadee.eu>
src/libsync/filesystem.cpp

index 7ff29ca4c1e855a64fb6ee1ee5830b997cf8f147..2931a3d877c7ec62d2882f490428b4ea1f2e0d64 100644 (file)
@@ -371,7 +371,7 @@ bool FileSystem::setFolderPermissions(const QString &path,
         qCWarning(lcFileSystem) << "error when calling GetSecurityDescriptorDacl" << path << GetLastError();
         return false;
     }
-    if (!daclPresent) {
+    if (!daclPresent || !resultDacl) {
         qCWarning(lcFileSystem) << "error when calling DACL needed to set a folder read-only or read-write is missing" << path;
         return false;
     }