tkivy: sanitize inputs - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 011ccc6e54440c2746830e544c2cbb96b7617670 DIR parent df02269bcfdb2cfc5794a230795995b7b89120e9 HTML Author: ThomasV <thomasv@electrum.org> Date: Fri, 4 Dec 2015 12:01:13 +0100 kivy: sanitize inputs Diffstat: M gui/kivy/uix/screens.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- DIR diff --git a/gui/kivy/uix/screens.py b/gui/kivy/uix/screens.py t@@ -207,11 +207,15 @@ class SendScreen(CScreen): def do_send(self): address = str(self.screen.address) - amount = self.app.get_amount(self.screen.amount) - message = unicode(self.screen.message) - if not bitcoin.is_address(self.address): + if not bitcoin.is_address(address): self.app.show_error(_('Invalid Bitcoin Address') + ':\n' + address) return + try: + amount = self.app.get_amount(self.screen.amount) + except: + self.app.show_error(_('Invalid amount') + ':\n' + self.screen.amount) + return + message = unicode(self.screen.message) fee = None outputs = [('address', address, amount)] self.app.password_dialog(self.send_tx, (outputs, fee, message))