Skip to content

Commit

Permalink
further improved. Should be fully patched
Browse files Browse the repository at this point in the history
  • Loading branch information
prodigysml committed Sep 7, 2023
1 parent 1081710 commit 4efb9f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pydantic/networks.py
Expand Up @@ -391,7 +391,7 @@ def _build_pretty_email_regex() -> re.Pattern:
unquoted_name_group = fr'((?:{name_chars}+\s+)*{name_chars}+)'
quoted_name_group = r'"((?:[^"]|\")+)"'
# altered regex to no longer be susceptible to denial of service
email_group = r'<\s{0,5}(.+)\s{0,5}>'
email_group = r'<\s{0,5}(.{0,3000})\s{0,5}>'
return re.compile(rf'\s*(?:{unquoted_name_group}|{quoted_name_group})?\s*{email_group}\s*')


Expand Down

0 comments on commit 4efb9f3

Please sign in to comment.