From 7bd0e9cc2f9c7b0b50d622443afb57eba7a502c6 Mon Sep 17 00:00:00 2001 From: Adam Dobrawy Date: Fri, 21 Sep 2018 22:00:10 +0200 Subject: [PATCH] Fix catastrophic backtracking in regexp Co-Author: @Nipsuli --- talon/quotations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talon/quotations.py b/talon/quotations.py index 996f79d..51cf027 100644 --- a/talon/quotations.py +++ b/talon/quotations.py @@ -286,7 +286,7 @@ def process_marked_lines(lines, markers, return_flags=[False, -1, -1]): # inlined reply # use lookbehind assertions to find overlapping entries e.g. for 'mtmtm' # both 't' entries should be found - for inline_reply in re.finditer('(?<=m)e*((?:t+e*)+)m', markers): + for inline_reply in re.finditer('(?<=m)e*(t[te]*)m', markers): # long links could break sequence of quotation lines but they shouldn't # be considered an inline reply links = (