Restrict QProcess::ProcessChannelMode to two used values.
Casting and passing the processChannel argument unfiltered to QProcess could pose a security issue if future additions are made to QProcess that introduce new behaviour.
This commit is contained in:
parent
1502494eda
commit
5d1c03b9d8
|
@ -334,6 +334,11 @@ QVariantMap ExternalCommandHelper::RunCommand(const QString& command, const QStr
|
|||
|
||||
QProcess cmd;
|
||||
cmd.setEnvironment( { QStringLiteral("LVM_SUPPRESS_FD_WARNINGS=1") } );
|
||||
|
||||
if((processChannelMode != QProcess::SeparateChannels) && (processChannelMode != QProcess::MergedChannels)) {
|
||||
reply[QStringLiteral("success")] = false;
|
||||
return reply;
|
||||
}
|
||||
cmd.setProcessChannelMode(static_cast<QProcess::ProcessChannelMode>(processChannelMode));
|
||||
cmd.start(command, arguments);
|
||||
cmd.write(input);
|
||||
|
|
Loading…
Reference in New Issue