diff options
author | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2015-04-16 14:13:44 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2015-04-16 15:45:50 +0000 |
commit | 5fc52ba6e2a5425ea8edcef8aad80d9d20f47f9c (patch) | |
tree | 2e0f267febaa1b090b6d8f3a8d45880fc03607f0 | |
parent | 6cea45cc24ff1e29ded753656b2830f0fae06742 (diff) |
QWindowsPipeReader: zero OVERLAPPED struct before every ReadFile
According to the documentation we should always pass a zeroed
OVERLAPPED object to ReadFile.
Change-Id: I3f822af46a2c38e029e02461f706c4fd91c00c50
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
-rw-r--r-- | src/corelib/io/qwindowspipereader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp index c3159ca367..8b1ec83833 100644 --- a/src/corelib/io/qwindowspipereader.cpp +++ b/src/corelib/io/qwindowspipereader.cpp @@ -89,7 +89,6 @@ void QWindowsPipeReader::setHandle(HANDLE hPipeReadEnd) readBuffer.clear(); actualReadBufferSize = 0; handle = hPipeReadEnd; - ZeroMemory(&overlapped, sizeof(overlapped)); pipeBroken = false; readyReadEmitted = false; if (hPipeReadEnd != INVALID_HANDLE_VALUE) { @@ -206,6 +205,7 @@ void QWindowsPipeReader::startAsyncRead() char *ptr = readBuffer.reserve(bytesToRead); readSequenceStarted = true; + ZeroMemory(&overlapped, sizeof(overlapped)); if (ReadFile(handle, ptr, bytesToRead, NULL, &overlapped)) { // We get notified by the QWinOverlappedIoNotifier - even in the synchronous case. return; |