Skip to content

Commit

Permalink
fixed possible DoS - there was no limit on the number of addr entries
Browse files Browse the repository at this point in the history
  • Loading branch information
forrestv committed Jan 8, 2013
1 parent 5d5f6f9 commit e04f198
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion p2pool/p2p.py
Expand Up @@ -634,7 +634,8 @@ def got_addr(self, (host, port), services, timestamp):
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)
Expand Down

0 comments on commit e04f198

Please sign in to comment.