summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-02-25 13:22:08 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-02-25 16:08:44 +0100
commit2af45d0cee253a6bc4e6807076445439cc69c2ce (patch)
tree73cd2765a6e289f4c8fc9ec725f1743d245588e5 /src/network
parent2de7f4f771dc0b903374c213201d5334f1a9316b (diff)
Assert that we have a socketEngine before calling it
If we are connected or bound, then we must have an engine. Otherwise in code we frequently test for the d->socketEngine pointer, including in waitForConnected. Fixes static anlyzer warning 3b37ce4102843c97ceef2b7bb68a409d. Pick-to: 6.1 Change-Id: Ib9818282ad2813db97859cbe1f184bcfb5ea4ab4 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/socket/qabstractsocket.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index f3885a22fe..31847c0142 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -2197,6 +2197,7 @@ bool QAbstractSocket::waitForReadyRead(int msecs)
do {
if (state() != ConnectedState && state() != BoundState)
return false;
+ Q_ASSERT(d->socketEngine);
bool readyToRead = false;
bool readyToWrite = false;