Commit ee0a1e1b authored by Andrius Štikonas's avatar Andrius Štikonas
Browse files

Add a limit on the amount of data that can be passed back via DBus.

parent c556f390
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment