Do not store more than 10M characters in ExternalCommand output.

BUG: 368674
This commit is contained in:
Andrius Štikonas 2017-09-15 14:59:59 +01:00
parent ec89795326
commit 687e3fc7d4
1 changed files with 6 additions and 0 deletions

View File

@ -118,6 +118,12 @@ void ExternalCommand::onReadOutput()
{
const QString s = QString::fromUtf8(readAllStandardOutput());
if(m_Output.length() > 10*1024*1024) { // prevent memory overflow for badly corrupted file systems
if (report())
report()->line() << xi18nc("@info:status", "(Command is printing too much output)");
return;
}
m_Output += s;
if (report())