From 90e0dd28f4d926ed90020916d1b991d8797afe38 Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Tue, 2 Jul 2024 20:29:50 +0300 Subject: [PATCH] Add a minimal sanity check for addresses in the received addr message --- minode/connection.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/minode/connection.py b/minode/connection.py index 05d552a..e9f0b0d 100644 --- a/minode/connection.py +++ b/minode/connection.py @@ -411,6 +411,8 @@ class ConnectionBase(threading.Thread): addr = message.Addr.from_message(m) logging.debug('%s:%s -> %s', self.host_print, self.port, addr) for a in addr.addresses: + if not a.host or a.port == 0: + continue if (a.host, a.port) not in shared.core_nodes: shared.unchecked_node_pool.add((a.host, a.port))