Skip to content
Snippets Groups Projects
Commit 802aec44 authored by jkerdreu's avatar jkerdreu
Browse files

Sanity check message source

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/trunk@1944 b32b6428-25c9-4566-ad07-03861ab6144f
parent cc67a980
Branches
Tags
No related merge requests found
......@@ -151,8 +151,8 @@ class MessageFactory(object):
msg.body = body
# Sanity check incomming message
if msg.source == None:
raise MessageParserError("Wrong message source == None")
if not tools.is_valid_addr(msg.source):
raise MessageParserError("Wrong message source [%s]" % msg.source)
return msg
#####################################################
......
......@@ -90,6 +90,8 @@ def get_random_uuid():
def is_valid_addr(val):
if val == None:
return False
if re.match(XAAL_ADDR_PATTERN,val):
return True
return False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment