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 613899be24
commit ce0f00fc2d

View file

@ -241,6 +241,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;