Details
Description
QProcess will crash on Windows when passing an empty program and an empty argument list.
#include <QCoreApplication> #include <QProcess> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QProcess p; p.start(QString(), QStringList()); return a.exec(); }
The reason is that the QString args whose buffer is passed to CreateProcess is a null QString in this case.
The QString args points to readonly memory. However, CreateProcess must be able to modify the argument buffer.
Note that the following code is not affected:
QProcess p; p.start(QString());
In this case QProcess::start() bails out if the argument is empty.