Check for relative paths in ExternalCommandHelper::CopyBlocks.

This commit is contained in:
Andrius Štikonas 2022-02-05 13:48:37 +00:00
parent 5d1c03b9d8
commit 949ce01ae4
1 changed files with 7 additions and 0 deletions

View File

@ -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;