summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-02 21:30:09 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-03 12:43:01 (GMT)
commitf080d232ef072976b28ca4b448dcb210b5941b2e (patch)
tree34d585105a58d37467dcc5c03b738ad24b6bff14 /src/network
parent20cfe1e790295254370cf472df39813f864de7ea (diff)
downloadQt-f080d232ef072976b28ca4b448dcb210b5941b2e.zip
Qt-f080d232ef072976b28ca4b448dcb210b5941b2e.tar.gz
Qt-f080d232ef072976b28ca4b448dcb210b5941b2e.tar.bz2
fix canReadLine() erroneously returning true
the indexOf() call did not consider actualReadBufferSize and thus scanned uninitialized memory for newlines. Reviewed-by: phartman
Diffstat (limited to 'src/network')
-rw-r--r--src/network/socket/qlocalsocket_win.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp
index 8a745ab..d812d88 100644
--- a/src/network/socket/qlocalsocket_win.cpp
+++ b/src/network/socket/qlocalsocket_win.cpp
@@ -363,7 +363,8 @@ bool QLocalSocket::canReadLine() const
Q_D(const QLocalSocket);
if (state() != ConnectedState)
return false;
- return (d->readBuffer.indexOf('\n') != -1 || QIODevice::canReadLine());
+ return (QIODevice::canReadLine()
+ || d->readBuffer.indexOf('\n', d->actualReadBufferSize) != -1);
}
void QLocalSocket::close()