]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - qwebirc/ajaxengine.py
Add maximum line lengths.
[irc/quakenet/qwebirc.git] / qwebirc / ajaxengine.py
index 84b4a0982137cf6973f3f409ee2c517a71b1fb6f..ff6bd8ef9718946002e66d949e02a4e2da61cbae 100644 (file)
@@ -181,6 +181,10 @@ class AJAXEngine(resource.Resource):
       except UnicodeDecodeError:
         decoded = command.decode("iso-8859-1", "ignore")
 
+      if len(decoded) > config.MAXLINELEN:
+        session.disconnect()
+        return [False, "Line too long"]
+
       try:
         session.push(decoded)
       except AttributeError: # occurs when we haven't noticed an error