don't allow attacker to fill memory/screen with data through sub_version
authorForrest Voight <forrest@forre.st>
Mon, 1 Aug 2011 07:37:40 +0000 (03:37 -0400)
committerForrest Voight <forrest@forre.st>
Mon, 1 Aug 2011 07:37:40 +0000 (03:37 -0400)
p2pool/p2p.py

index 993a0bd..a6605a5 100644 (file)
@@ -96,7 +96,7 @@ class Protocol(bitcoin_p2p.BaseProtocol):
     ])
     def handle_version(self, version, services, addr_to, addr_from, nonce, sub_version, mode, best_share_hash):
         self.other_version = version
-        self.other_sub_version = sub_version
+        self.other_sub_version = sub_version[:512]
         self.other_services = services
         self.other_mode_var = variable.Variable(mode)