From 949ce01ae424d42552b9adb4b03db53e940bb764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sat, 5 Feb 2022 13:48:37 +0000 Subject: [PATCH] Check for relative paths in ExternalCommandHelper::CopyBlocks. --- src/util/externalcommandhelper.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/util/externalcommandhelper.cpp b/src/util/externalcommandhelper.cpp index 614cc33..403d41a 100644 --- a/src/util/externalcommandhelper.cpp +++ b/src/util/externalcommandhelper.cpp @@ -172,6 +172,13 @@ QVariantMap ExternalCommandHelper::CopyBlocks(const QString& sourceDevice, const return {}; } + // Check for relative paths + std::filesystem::path sourcePath(sourceDevice.toStdU16String()); + std::filesystem::path targetPath(targetDevice.toStdU16String()); + if(sourcePath.is_relative() || targetPath.is_relative()) { + return {}; + } + QVariantMap reply; reply[QStringLiteral("success")] = true;