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

[panic]: index out of bounds: the len is 1 but the index is 2 #3425

Closed
qarmin opened this issue Mar 9, 2023 · 5 comments
Closed

[panic]: index out of bounds: the len is 1 but the index is 2 #3425

qarmin opened this issue Mar 9, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@qarmin
Copy link

qarmin commented Mar 9, 2023

0.0.254
Config with all rules

thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 2', crates/ruff/src/source_code/locator.rs:71:9

_bgcolor (8th copy)15.py.zip

@qarmin
Copy link
Author

qarmin commented Mar 9, 2023

I have more crashes in other lines in locator.rs, but probably this are duplicates of this issue

@charliermarsh
Copy link
Member

Def agree that we shouldn't be panicking, but is that valid Python code? How would you describe the contents of that file? I'm trying to make sure I'm not misinterpreting the issue.

Screen Shot 2023-03-09 at 4 14 38 PM

@qarmin
Copy link
Author

qarmin commented Mar 9, 2023

This is found by fuzzer.
I provided valid python file and changed some bytes/charaters to find possible crashes

@charliermarsh charliermarsh added the bug Something isn't working label Mar 10, 2023
@qarmin
Copy link
Author

qarmin commented Mar 11, 2023

Smaller reproducer - a.py.zip

@charliermarsh
Copy link
Member

Okay, this is now resolved via #3454 and #3439.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants