summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-12-14 16:45:23 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-12-14 15:53:42 +0000
commit3c8cf550740746a0b6e8ed77569c8c57c9c14f6b (patch)
tree6c82095b82f3a0ce51cacb66ff4dca5f5cbfd0a7 /src
parenta8ff0bc887f192bd03cdd937972491059fbebf53 (diff)
QProcess/Windows: Fix handling of workingDirectory.
Store nativeWorkingDirectory in a variable on the stack to prevent accessing the buffer of a temporary string. Fix breakage introduced by 068baa9bb6d526cccc0c8bc7cdbb84bbdf137f95. Change-Id: I8cf9ffe39c97afc9383c33cafaeffb1245b3e2b9 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qprocess_win.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index bb5bb4b0a5..69d9ac6e87 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -498,11 +498,12 @@ void QProcessPrivate::startProcess()
stdinChannel.pipe[0], stdoutChannel.pipe[1], stderrChannel.pipe[1]
};
+ const QString nativeWorkingDirectory = QDir::toNativeSeparators(workingDirectory);
QProcess::CreateProcessArguments cpargs = {
0, (wchar_t*)args.utf16(),
0, 0, TRUE, dwCreationFlags,
environment.isEmpty() ? 0 : envlist.data(),
- workingDirectory.isEmpty() ? 0 : (wchar_t*)QDir::toNativeSeparators(workingDirectory).utf16(),
+ nativeWorkingDirectory.isEmpty() ? Q_NULLPTR : (wchar_t*)nativeWorkingDirectory.utf16(),
&startupInfo, pid
};
if (modifyCreateProcessArgs)