URI: 
       tsanitize server and protocol - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 761871b9006085473b337df0ea563189615b8090
   DIR parent 48838be816fc897a8687e95e6f86d8c40e5a9bfc
  HTML Author: ThomasV <thomasv@gitorious>
       Date:   Wed, 25 Feb 2015 17:14:31 +0100
       
       sanitize server and protocol
       
       Diffstat:
         M lib/network.py                      |       9 +++++++++
       
       1 file changed, 9 insertions(+), 0 deletions(-)
       ---
   DIR diff --git a/lib/network.py b/lib/network.py
       t@@ -96,10 +96,19 @@ class Network(threading.Thread):
                self.interfaces = {}
                self.queue = Queue.Queue()
                self.protocol = self.config.get('protocol','s')
       +        # sanitize protocol
       +        if self.protocol not in 'sght': self.protocol = 's'
                self.running = False
        
                # Server for addresses and transactions
                self.default_server = self.config.get('server')
       +        # Sanitize default server
       +        try:
       +            host, port, protocol = self.default_server.split(':')
       +            assert protocol == self.protocol
       +            int(port)
       +        except:
       +            self.default_server = None
                if not self.default_server:
                    self.default_server = pick_random_server(self.protocol)