Merge pull request #172 from ad-m/patch-1

Fix catastrophic backtracking in regexp
This commit is contained in:
Sergey Obukhov
2018-11-02 09:09:49 +03:00
committed by GitHub

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