bpo-32179: Fix handling of empty email address in header parsing#4644
Closed
mtorromeo wants to merge 1 commit into
Closed
bpo-32179: Fix handling of empty email address in header parsing#4644mtorromeo wants to merge 1 commit into
mtorromeo wants to merge 1 commit into
Conversation
In case an address email header contains and empty string, the tokenizer return a `BareQuotedString` which is also a `TokenList`, but this list is empty and the parser fails to check this and insteads raises an `IndexError`. For example an email with this header will trigger the `IndexError`: `ReplyTo: ""`
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
Contributor
|
I commented on b.p.o, but this issue seems to be fixed in the master. I am not sure when and which PR fixed it. Thanks @mtorromeo for this though :) |
Contributor
|
Closing per @maxking's comments about not being able to recreate the issue. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In case an address email header contains and empty string, the tokenizer return a
BareQuotedStringwhich is also a
TokenList, but this list is empty and the parser fails to check this and insteads raises anIndexError.For example an email with this header will trigger the
IndexError:ReplyTo: ""https://bugs.python.org/issue32179