From 0884f42379a0df422db2267aa00672aab5e76205 Mon Sep 17 00:00:00 2001 From: andryyy Date: Thu, 27 Aug 2020 21:13:30 +0200 Subject: [PATCH] [Netfilter] Skip invalid regex --- data/Dockerfiles/netfilter/server.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/Dockerfiles/netfilter/server.py b/data/Dockerfiles/netfilter/server.py index 32dea8e4..36565dbc 100644 --- a/data/Dockerfiles/netfilter/server.py +++ b/data/Dockerfiles/netfilter/server.py @@ -305,7 +305,10 @@ def watch(): refreshF2bregex() for rule_id, rule_regex in f2bregex.items(): if item['data'] and item['type'] == 'message': - result = re.search(rule_regex, item['data']) + try: + result = re.search(rule_regex, item['data']) + except re.error: + result = False if result: addr = result.group(1) ip = ipaddress.ip_address(addr)