From e5d8631948721a3a06e60fda96da7c58d9a9652d Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 29 Sep 2012 21:59:09 -0400 Subject: [PATCH] Reject input that doesn't parse to a dict. --- irkerd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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'] -- 2.26.2