From 24f71534dd6b862886fd503d2b0c50b619cf133a Mon Sep 17 00:00:00 2001 From: Tib3rius <48113936+Tib3rius@users.noreply.github.com> Date: Tue, 3 Aug 2021 00:08:40 -0400 Subject: [PATCH] Update autorecon.py Fixes #68 Instead of messing around with limits, we should ignore any line longer than 64 KiB, as it is likely invalid data of some kind anyway. --- autorecon.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/autorecon.py b/autorecon.py index 4feb510..7851036 100644 --- a/autorecon.py +++ b/autorecon.py @@ -161,7 +161,12 @@ class CommandStreamReader(object): while True: if self.stream.at_eof(): break - line = (await self.stream.readline()).decode('utf8').rstrip() + try: + line = (await self.stream.readline()).decode('utf8').rstrip() + except ValueError: + error('{blue}[{bright}' + self.target.address + '/' + self.tag + '{srst}]{crst} A line was longer than 64 KiB and cannot be processed. Ignoring.') + continue + if self.target.autorecon.config['verbose'] >= 2: if line != '': info('{blue}[{bright}' + self.target.address + '/' + self.tag + '{srst}]{crst} ' + line.replace('{', '{{').replace('}', '}}'))