fix: non-utf8 source causes panic, close #3798#3884
Merged
youknowone merged 4 commits intoRustPython:mainfrom Jul 15, 2022
Merged
fix: non-utf8 source causes panic, close #3798#3884youknowone merged 4 commits intoRustPython:mainfrom
youknowone merged 4 commits intoRustPython:mainfrom
Conversation
Contributor
Author
|
The |
62acbd2 to
96488a8
Compare
fanninpm
reviewed
Jul 14, 2022
Contributor
There was a problem hiding this comment.
We can use the assert_raises context manager from the testutils module1. (My suggestion will cause RustPython to fail the test because it raises the wrong exception.)
Footnotes
fanninpm
reviewed
Jul 14, 2022
Co-authored-by: fanninpm <fanninpm@miamioh.edu>
Co-authored-by: fanninpm <fanninpm@miamioh.edu>
youknowone
approved these changes
Jul 15, 2022
Member
youknowone
left a comment
There was a problem hiding this comment.
nice catch and fix, 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.
Try to fix #3798 .
I found that it's panic at
unicode_name2:character: https://github.com/progval/unicode_names2/blob/master/src/lib.rs#L323The unicode name's length exceeds
MAX_NAME_LENGTH:The patch just added a checking before calling
unicode_name2:character. ButMAX_NAME_LENGTHis not public inunicode_name2, so i added a const tolexer.rs: