diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-05-12 09:56:40 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-05-12 09:56:40 +0200 |
commit | 3ece965de9473769d55f8387df4c1c2dc961ba48 (patch) | |
tree | f8304b77ed175fe8db199757d11b3cadb8624c52 | |
parent | 287d50705266a05214f14fb276c3496a4c42e87f (diff) |
sshban: handle invalid input
-rwxr-xr-x | sshban.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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) |