Fix catastrophic backtracking in regexp

Co-Author: @Nipsuli
This commit is contained in:
Adam Dobrawy
2018-09-21 22:00:10 +02:00
committed by GitHub
parent a7404afbcb
commit 7bd0e9cc2f

View File

@@ -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 = (