From 4d3f5ac0cc731a1120154f707bceb57eb4ddabe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Mon, 31 Oct 2022 15:13:04 +0100 Subject: QHostAddress: Fix incorrect comparison against 'Any' When 'this' is IPv6 and 'other' is Any then there is no point in testing 'other's IPv6 address. Added extra tests against QHostAddress::Any*. Pick-to: 6.4 6.2 5.15 Fixes: QTBUG-108103 Change-Id: I09f32b1b147b1ec8380546c91cd89684a6bebe2e Reviewed-by: Thiago Macieira --- src/network/kernel/qhostaddress.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/network/kernel') diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp index 2f673d8c6d..827b622ac0 100644 --- a/src/network/kernel/qhostaddress.cpp +++ b/src/network/kernel/qhostaddress.cpp @@ -818,7 +818,7 @@ bool QHostAddress::isEqual(const QHostAddress &other, ConversionMode mode) const return memcmp(&d->a6, &other.d->a6, sizeof(Q_IPV6ADDR)) == 0; case QHostAddress::AnyIPProtocol: return (mode & QHostAddress::ConvertUnspecifiedAddress) - && (other.d->a6_64.c[0] == 0) && (other.d->a6_64.c[1] == 0); + && (d->a6_64.c[0] == 0) && (d->a6_64.c[1] == 0); case QHostAddress::UnknownNetworkLayerProtocol: return false; } -- cgit v1.2.3