From 3614960471943f4343405dc6786aee46d1fb85d8 Mon Sep 17 00:00:00 2001 From: Griatch Date: Thu, 22 Oct 2009 20:10:31 +0000 Subject: [PATCH] Protected the server against non-standard characters on input line; this would give traceback or weird results before. /Griatch --- src/session.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/session.py b/src/session.py index 8a000cf4e..84beb7e32 100755 --- a/src/session.py +++ b/src/session.py @@ -78,6 +78,12 @@ class SessionProtocol(StatefulTelnetProtocol): Any line return indicates a command for the purpose of a MUD. So we take the user input and pass it to this session's pobject. """ + try: + data = u"%s" % data + except UnicodeDecodeError: + self.msg("Couldn't parse that. You put some non-standard characters in there.") + return + if self.pobject: # Session is logged in, run through the normal object execution. self.pobject.execute_cmd(data, session=self)