From 6ffe1d81c24c77dd2d6b6b1076e2dac6a1dfe522 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Mon, 10 Jul 2023 20:13:37 +0200 Subject: [PATCH] P2PServer: ignore protocol versions higher than supported --- src/p2p_server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p2p_server.cpp b/src/p2p_server.cpp index 58e0bbf..7761bbc 100644 --- a/src/p2p_server.cpp +++ b/src/p2p_server.cpp @@ -2317,7 +2317,7 @@ void P2PServer::P2PClient::on_peer_list_response(const uint8_t* buf) // Check for protocol version message if ((*reinterpret_cast(ip.data + 12) == 0xFFFFFFFFU) && (port == 0xFFFF)) { - m_protocolVersion = *reinterpret_cast(ip.data); + m_protocolVersion = std::min(*reinterpret_cast(ip.data), SUPPORTED_PROTOCOL_VERSION); m_SoftwareVersion = *reinterpret_cast(ip.data + 4); m_SoftwareID = *reinterpret_cast(ip.data + 8); LOGINFO(5, "peer " << log::Gray() << static_cast(m_addrString) << log::NoColor()