diff --git a/src/util/externalcommandhelper.cpp b/src/util/externalcommandhelper.cpp index e485986..cbfa76e 100644 --- a/src/util/externalcommandhelper.cpp +++ b/src/util/externalcommandhelper.cpp @@ -163,10 +163,15 @@ QVariantMap ExternalCommandHelper::CopyBlocks(const QString& sourceDevice, const if (!blockSize) { return QVariantMap(); } + + // Prevent some out of memory situations constexpr qint64 MiB = 1 << 30; if (blockSize > 100 * MiB) { return QVariantMap(); } + if (targetDevice.isEmpty() && sourceLength > MiB) { + return QVariantMap(); + } QVariantMap reply; reply[QStringLiteral("success")] = true;