Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

email.utils.parsedate_tz() crashes on certain inputs #95087

Closed
wbolster opened this issue Jul 21, 2022 · 1 comment
Closed

email.utils.parsedate_tz() crashes on certain inputs #95087

wbolster opened this issue Jul 21, 2022 · 1 comment
Labels
topic-email type-bug An unexpected behavior, bug, or error

Comments

@wbolster
Copy link
Contributor

Date/time parsing routines in the email module can crash (instead of returning None) for certain inputs:

>>> email.utils.parsedate_tz('17 June , 2022')
IndexError: string index out of range

This is similar to bpo-45001 (GH-89164)

@wbolster wbolster added the type-bug An unexpected behavior, bug, or error label Jul 21, 2022
wbolster added a commit to wbolster/cpython that referenced this issue Jul 22, 2022
Similar to bpo-45001 (pythonGH-89164), this makes email date parsing more
robust against malformed input. parsedate_tz() is supposed to return
None for malformed input, but could crash on certain inputs, e.g.

    >>> email.utils.parsedate_tz('17 June , 2022')
    IndexError: string index out of range

Fixes pythongh-95087.
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Jul 24, 2022
…odule

Co-authored-by: wouter bolsterlee <wouter@bolsterl.ee>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 25, 2022
…odule (pythonGH-95201)

Co-authored-by: wouter bolsterlee <wouter@bolsterl.ee>
(cherry picked from commit ea5ed0b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this issue Jul 25, 2022
…H-95201)

Co-authored-by: wouter bolsterlee <wouter@bolsterl.ee>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 25, 2022
…odule (pythonGH-95201)

Co-authored-by: wouter bolsterlee <wouter@bolsterl.ee>
(cherry picked from commit ea5ed0b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington added a commit that referenced this issue Jul 25, 2022
…H-95201)

Co-authored-by: wouter bolsterlee <wouter@bolsterl.ee>
(cherry picked from commit ea5ed0b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington added a commit that referenced this issue Jul 25, 2022
…H-95201)

Co-authored-by: wouter bolsterlee <wouter@bolsterl.ee>
(cherry picked from commit ea5ed0b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@corona10
Copy link
Member

corona10 commented Jul 30, 2022

close via #95201

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-email type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants