Limit the ports we try to connect to to the port range of KDE Connect

So we can't trigger connections to other services.

Thanks Matthias Gerstner <mgerstner@suse.de> for reporting this.
This commit is contained in:
Albert Vaca Cintora 2020-09-24 17:18:06 +02:00
parent 66c768aa9e
commit 85b691e40f

View file

@ -223,6 +223,11 @@ void LanLinkProvider::udpBroadcastReceived()
}
int tcpPort = receivedPacket->get<int>(QStringLiteral("tcpPort"));
if (tcpPort < MIN_TCP_PORT || tcpPort > MAX_TCP_PORT) {
qCDebug(KDECONNECT_CORE) << "TCP port outside of kdeconnect's range";
delete receivedPacket;
continue;
}
//qCDebug(KDECONNECT_CORE) << "Received Udp identity packet from" << sender << " asking for a tcp connection on port " << tcpPort;