Add a limit on blocksize to prevent out-of-memory situation.
This commit is contained in:
parent
9dd38744c5
commit
c556f39064
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue