Browse Source

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

master
Andrius Štikonas 3 months ago
parent
commit
c556f39064
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      src/util/externalcommandhelper.cpp

+ 5
- 0
src/util/externalcommandhelper.cpp View File

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


Loading…
Cancel
Save