diff --git a/src/util/externalcommandhelper.cpp b/src/util/externalcommandhelper.cpp index 9bdc527..665e4da 100644 --- a/src/util/externalcommandhelper.cpp +++ b/src/util/externalcommandhelper.cpp @@ -179,6 +179,11 @@ QVariantMap ExternalCommandHelper::CopyFileData(const QString& sourceDevice, con return {}; } + // Only allow writing to existing files. + if(!std::filesystem::exists(targetPath)) { + return {}; + } + QVariantMap reply; reply[QStringLiteral("success")] = true;