Skip to content

Commit 6ff9cd9

Browse files
Attempt to fix ReDoS issue.
1 parent ad657dd commit 6ff9cd9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

hcl2/transformer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
from lark.visitors import Transformer, Discard, _DiscardType
88

9-
HEREDOC_PATTERN = re.compile(r"<<([a-zA-Z][a-zA-Z0-9._-]+)\n((.|\n)*)\1", re.S)
10-
HEREDOC_TRIM_PATTERN = re.compile(r"<<-([a-zA-Z][a-zA-Z0-9._-]+)\n((.|\n)*)\1", re.S)
9+
HEREDOC_PATTERN = re.compile(r"<<([a-zA-Z][a-zA-Z0-9._-]+)\n([\s\S]*)\1", re.S)
10+
HEREDOC_TRIM_PATTERN = re.compile(r"<<-([a-zA-Z][a-zA-Z0-9._-]+)\n([\s\S]*)\1", re.S)
1111

1212
Attribute = namedtuple("Attribute", ("key", "value"))
1313

0 commit comments

Comments
 (0)