From: Forrest Voight Date: Tue, 8 Jan 2013 06:04:32 +0000 (-0500) Subject: fixed possible DoS - there was no limit on the number of addr entries X-Git-Tag: 11.1~2 X-Git-Url: https://git.novaco.in/?p=p2pool.git;a=commitdiff_plain;h=e04f1981260276b9cdd9bdf7d90f2543d9b5b890;hp=5d5f6f91a3220768b1886c32d9ff9aea88ffbb2f fixed possible DoS - there was no limit on the number of addr entries --- diff --git a/p2pool/p2p.py b/p2pool/p2p.py index 99a9e87..343d49f 100644 --- a/p2pool/p2p.py +++ b/p2pool/p2p.py @@ -634,7 +634,8 @@ class Node(object): old_services, old_first_seen, old_last_seen = self.addr_store[host, port] self.addr_store[host, port] = services, old_first_seen, max(old_last_seen, timestamp) else: - self.addr_store[host, port] = services, timestamp, timestamp + if len(self.addr_store) < 10000: + self.addr_store[host, port] = services, timestamp, timestamp def handle_shares(self, shares, peer): print 'handle_shares', (shares, peer)