From e2f90554b0f9ce2dc520ff342b248afd12beb1c8 Mon Sep 17 00:00:00 2001 From: Juhani Haverinen Date: Tue, 3 Feb 2015 18:32:29 +0200 Subject: [PATCH] Sanitize send()ed stuff --- ircbot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ircbot.py b/ircbot.py index 358fbdc..4168739 100755 --- a/ircbot.py +++ b/ircbot.py @@ -53,6 +53,7 @@ class Connhandler(threading.Thread): self.inpc=inpc self.logc=logc def send(self,s): + s=s.replace('\n','\\n').replace('\r','\\r') # Sanitize output if len(s)>512: s=s[:512] self.sock.send(s+'\r\n') if s.split(' ')[0]!='PONG':