diff options
author | Christian Strømme <christian.stromme@digia.com> | 2013-08-13 11:20:05 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-28 23:51:11 (GMT) |
commit | 764f1a51209212b6fc60cef5c12e9748d06b57de (patch) | |
tree | d3f6f6dbf582786bc2bdd25c7387dac7b237df2d /src | |
parent | 9b62d3ef0bb3109f4d2d29a0b8fc6cf792729618 (diff) | |
download | Qt-764f1a51209212b6fc60cef5c12e9748d06b57de.zip Qt-764f1a51209212b6fc60cef5c12e9748d06b57de.tar.gz Qt-764f1a51209212b6fc60cef5c12e9748d06b57de.tar.bz2 |
Fix crash in QProcess::waitForStarted() on Unix.
Invoking waitForStarted() on a QProcess before or after an unsuccessful
call to start() (e.g., with an empty command), would execute FD_SET with
an invalid file descriptor and cause the process to abort.
The bug can be reliably reproduced on OSX.
(cherry-picked from qtbase commit c8d9b17367cfdcb034d11f8a168ca4ae3993e7c3)
Task-number: QTBUG-32958
Change-Id: Id25b7781168489281645e21571361ca1a71d43e3
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qprocess.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 4f1b09f..ae1a4e4 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -1702,10 +1702,10 @@ QProcessEnvironment QProcess::processEnvironment() const bool QProcess::waitForStarted(int msecs) { Q_D(QProcess); - if (d->processState == QProcess::Running) - return true; + if (d->processState == QProcess::Starting) + return d->waitForStarted(msecs); - return d->waitForStarted(msecs); + return d->processState == QProcess::Running; } /*! \reimp |