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.
Attachments
For Gerrit Dashboard: QTBUG-47404 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
122114,2 | consistently handle empty program string in QProcess::start overloads | 5.5 | qt/qtbase | Status: MERGED | +2 | 0 |