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

Open
wbolster opened this issue Jul 21, 2022 · 0 comments · May be fixed by #95089
Open

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

wbolster opened this issue Jul 21, 2022 · 0 comments · May be fixed by #95089
Labels
expert-email type-bug

Comments

@wbolster
Copy link
Contributor

@wbolster wbolster commented Jul 21, 2022

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 label Jul 21, 2022
wbolster added a commit to wbolster/cpython that referenced this issue Jul 21, 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.
@wbolster wbolster linked a pull request Jul 21, 2022 that will close this issue
wbolster added a commit to wbolster/cpython that referenced this issue Jul 21, 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.
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 ea5ed0ba51c10cfdde7651a475438551964dfdfc)

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 ea5ed0ba51c10cfdde7651a475438551964dfdfc)

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expert-email type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants