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 authored and adriangb committed Sep 20, 2023
1 parent b27b96c commit 29f2a69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pydantic/networks.py
Expand Up @@ -421,7 +421,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 29f2a69

Please sign in to comment.