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

Add a limit on blocksize to prevent out-of-memory situation.

parent 9dd38744
...@@ -163,6 +163,11 @@ QVariantMap ExternalCommandHelper::CopyBlocks(const QString& sourceDevice, const ...@@ -163,6 +163,11 @@ QVariantMap ExternalCommandHelper::CopyBlocks(const QString& sourceDevice, const
if (!blockSize) { if (!blockSize) {
return QVariantMap(); return QVariantMap();
} }
constexpr qint64 MiB = 1 << 30;
if (blockSize > 100 * MiB) {
return QVariantMap();
}
QVariantMap reply; QVariantMap reply;
reply[QStringLiteral("success")] = true; 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