From c63de2cda39f640788786eeb0e95182c3de80e5b Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 4 Sep 2023 20:13:24 +0200 Subject: [PATCH] QHostInfo::lookupHostImpl: add another precondition check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If `member` is set it means that the caller wants us to connect to a slot using string-based connections. That means `receiver` must be non-null as well. Check for it. Change-Id: I6b3542855147e95fecbf4c645b556c2047a1ed69 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Thiago Macieira --- src/network/kernel/qhostinfo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index e7df47da6f2..fcd3a6963fb 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -750,6 +750,7 @@ int QHostInfo::lookupHostImpl(const QString &name, #endif Q_ASSERT(!member != !slotObj); // one of these must be set, but not both Q_ASSERT(receiver || slotObj); + Q_ASSERT(!member || receiver); // if member is set, also is receiver if (!QAbstractEventDispatcher::instance(QThread::currentThread())) { qWarning("QHostInfo::lookupHost() called with no event dispatcher");