summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMÃ¥rten Nordheim <marten.nordheim@qt.io>2017-09-20 15:42:54 +0200
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2017-09-20 15:08:11 +0000
commit0f32f4efc5a9a8b33369013c2ba6c27c78498cf2 (patch)
tree791b8f35e3452eaa290a72c005640fc6c4abecab
parent30de96f6d7ef01c1c5887405a4ad49cf44a5ab79 (diff)
downloadqtwebsockets-0f32f4efc5a9a8b33369013c2ba6c27c78498cf2.tar.gz
Change assert to null-check
Avoids a crash that would happen if readyRead was emitted after calling ::close on the websocket. Task-number: QTBUG-59179 Change-Id: I1e7bd19d99ee068b8699014fac9a72f839632c85 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r--src/websockets/qwebsocket_p.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp
index 11b33c5..7863567 100644
--- a/src/websockets/qwebsocket_p.cpp
+++ b/src/websockets/qwebsocket_p.cpp
@@ -1145,7 +1145,8 @@ void QWebSocketPrivate::socketDestroyed(QObject *socket)
*/
void QWebSocketPrivate::processData()
{
- Q_ASSERT(m_pSocket);
+ if (!m_pSocket) // disconnected with data still in-bound
+ return;
while (m_pSocket->bytesAvailable()) {
if (state() == QAbstractSocket::ConnectingState) {
if (!m_pSocket->canReadLine())