Add a limit on the amount of data that can be passed back via DBus.
This commit is contained in:
parent
c556f39064
commit
ee0a1e1b41
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue