mirror of
https://github.com/python/cpython.git
synced 2025-10-07 15:42:02 +00:00
bpo-38708: email: Fix a potential IndexError when parsing Message-ID (GH-17504)
Fix a potential IndexError when passing an empty value to the message-id parser. Instead, HeaderParseError should be raised.
This commit is contained in:
parent
68157da8b4
commit
3ae4ea1931
3 changed files with 8 additions and 1 deletions
|
@ -2047,7 +2047,7 @@ def get_msg_id(value):
|
|||
no-fold-literal = "[" *dtext "]"
|
||||
"""
|
||||
msg_id = MsgID()
|
||||
if value[0] in CFWS_LEADER:
|
||||
if value and value[0] in CFWS_LEADER:
|
||||
token, value = get_cfws(value)
|
||||
msg_id.append(token)
|
||||
if not value or value[0] != '<':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue