From: Albert S Date: Mon, 24 Jul 2017 13:51:56 +0000 (+0200) Subject: core: connectToIrc: Prevent DNS leaks on connection when using proxy X-Git-Tag: 0.12.5~22 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=e5eced005fac590ca191de83388d38ee403033ec core: connectToIrc: Prevent DNS leaks on connection when using proxy 96fe7e713 introduced a call to QHostInfo::fromName() in order to avoid problems related to the caching of DNS queries. It however is also called when the user has specified that a proxy should be used. This behavior therefore introduces a DNS leak. This commit ensures that QHostInfo::fromName() is not called when a proxy has been specified. (cherry picked from commit 8aa70869402f71328d1a5f92fa36aa9579dc333b) --- diff --git a/src/core/corenetwork.cpp b/src/core/corenetwork.cpp index 0ebcd19a..53960b66 100644 --- a/src/core/corenetwork.cpp +++ b/src/core/corenetwork.cpp @@ -218,8 +218,9 @@ void CoreNetwork::connectToIrc(bool reconnecting) // Qt caches DNS entries for a minute, resulting in round-robin (e.g. for chat.freenode.net) not working if several users // connect at a similar time. QHostInfo::fromName(), however, always performs a fresh lookup, overwriting the cache entry. - QHostInfo::fromName(server.host); - + if (! server.useProxy) { + QHostInfo::fromName(server.host); + } #ifdef HAVE_SSL if (server.useSsl) { CoreIdentity *identity = identityPtr();