From 843775e948f4adf92f3b769a469912fe5cc84373 Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Tue, 12 May 2020 15:43:06 +0000 Subject: [PATCH] Crash loudly if an IRC message is too long despite all the checks and splits --- http2irc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/http2irc.py b/http2irc.py index f36d179..9de99df 100644 --- a/http2irc.py +++ b/http2irc.py @@ -353,6 +353,8 @@ class IRCClientProtocol(asyncio.Protocol): def send(self, data): self.logger.debug(f'Send: {data!r}') + if len(data) > 510: + raise RuntimeError(f'IRC message too long ({len(data)} > 510): {data!r}') self.transport.write(data + b'\r\n') async def _get_message(self):