Permalink
Browse files

fixed possible DoS - there was no limit on the number of addr entries

  • Loading branch information...
1 parent 5d5f6f9 commit e04f1981260276b9cdd9bdf7d90f2543d9b5b890 @forrestv forrestv committed Jan 8, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 p2pool/p2p.py
View
3 p2pool/p2p.py
@@ -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)

0 comments on commit e04f198

Please sign in to comment.