From df7f4bffdc43407ee3c41c8703f9b9a698833220 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 c74af5d..fe57d1e 100644 --- a/minode/connection.py +++ b/minode/connection.py @@ -425,6 +425,8 @@ class Connection(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 shared.unchecked_node_pool.add((a.host, a.port)) elif m.command == b'ping':