From 3ece965de9473769d55f8387df4c1c2dc961ba48 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 12 May 2020 09:56:40 +0200 Subject: sshban: handle invalid input --- sshban.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sshban.py b/sshban.py index 102f4a3..11b5d4b 100755 --- a/sshban.py +++ b/sshban.py @@ -240,7 +240,11 @@ with open(fifofd) as fifo: if len(line) == 0: continue - ts, msg = line.rstrip().split(maxsplit = 1) + parts = line.rstrip().split(maxsplit = 1) + if len(parts) != 2: + logger.error('Invalid log line: %s' % line) + continue + ts, msg = parts logger.debug('processing message: %s' % msg) res = process_msg(ts, msg) -- cgit v1.2.3