From 204f1fe52cc82c8b16c223c2929c0cca0e1febeb Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Fri, 24 May 2013 17:05:45 -0400 Subject: [PATCH] Verify label is UTF-8 data --- src/bitmessagemain.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 9448404c..93acfa19 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -3798,6 +3798,10 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): if len(params) == 2: address, label = params label = label.decode('base64') + try: + label.decode('utf-8') + except UnicodeDecodeError: + return 'API Error 0017: Label is not valid UTF-8 data.' if len(params) >2: return 'API Error 0000: I need either 1 or 2 parameters!' address = addBMIfNotPresent(address)