diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2010-05-06 11:01:15 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2010-09-01 12:24:39 (GMT) |
commit | 140cde65eb7eb8ccede25f1759699835ff479bc5 (patch) | |
tree | 31edcba75cee963860b94e112b557a92b96ac0ed | |
parent | b3a93f3d5d7aaaa9b41eb1a5fc9082e5bec86a68 (diff) | |
download | Qt-140cde65eb7eb8ccede25f1759699835ff479bc5.zip Qt-140cde65eb7eb8ccede25f1759699835ff479bc5.tar.gz Qt-140cde65eb7eb8ccede25f1759699835ff479bc5.tar.bz2 |
Don't crash when trying to join/leave a group with not bound
d->socketEngine will be zero, which crashes. avoid this by returning if
the socket is not in the BoundState
-rw-r--r-- | src/network/socket/qudpsocket.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/network/socket/qudpsocket.cpp b/src/network/socket/qudpsocket.cpp index 4fc88dc..880cb2b 100644 --- a/src/network/socket/qudpsocket.cpp +++ b/src/network/socket/qudpsocket.cpp @@ -347,6 +347,7 @@ bool QUdpSocket::joinMulticastGroup(const QHostAddress &groupAddress, MulticastMode mode) { Q_D(QUdpSocket); + QT_CHECK_BOUND("QUdpSocket::joinMulticastGroup()", false); d->socketEngine->setOption(QAbstractSocketEngine::MulticastLoopback, (mode & MulticastLoopback) ? 1 : 0); return d->socketEngine->joinMulticastGroup(groupAddress, sourceAddress, interface); @@ -368,6 +369,7 @@ bool QUdpSocket::leaveMulticastGroup(const QHostAddress &groupAddress, const QHostAddress &sourceAddress, const QNetworkInterface &interface) { + QT_CHECK_BOUND("QUdpSocket::leaveMulticastGroup()", false); return d_func()->socketEngine->leaveMulticastGroup(groupAddress, sourceAddress, interface); } |