From: Eric S. Raymond Date: Sun, 30 Sep 2012 01:59:09 +0000 (-0400) Subject: Reject input that doesn't parse to a dict. X-Git-Tag: 1.2~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e5d8631948721a3a06e60fda96da7c58d9a9652d;p=irker.git Reject input that doesn't parse to a dict. --- diff --git a/irkerd b/irkerd index d249fca..bdcd54e 100755 --- a/irkerd +++ b/irkerd @@ -314,7 +314,9 @@ class Irker: "Perform a JSON relay request." try: request = json.loads(line.strip()) - if "to" not in request or "privmsg" not in request: + if type(request) != type({}): + self.logerr("request in tot a JSON dictionary: %s" % repr(request)) + elif "to" not in request or "privmsg" not in request: self.logerr("malformed reqest - 'to' or 'privmsg' missing: %s" % repr(request)) else: channels = request['to']