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

oss-fuzz: pest:parser: ASSERT: index out of bounds: the len is 0 but the index is 8 #686

Closed
tomtau opened this issue Aug 11, 2022 · 0 comments · Fixed by #687
Closed

oss-fuzz: pest:parser: ASSERT: index out of bounds: the len is 0 but the index is 8 #686

tomtau opened this issue Aug 11, 2022 · 0 comments · Fixed by #687
Labels

Comments

@tomtau
Copy link
Contributor

tomtau commented Aug 11, 2022

Describe the bug
Fuzzing found a crash due to indexing an empty vector.

match new_state.queue[index] {

thread '<unnamed>' panicked at 'index out of bounds: the len is 0 but the index is 8', [pest/pest/src/parser_state.rs:309](https://github.com/pest-parser/pest/blob/9c42f1293aa999b24cd8dea70469da3be3a4c9eb/pest/src/parser_state.rs#L309):27

To Reproduce
minimal sample:

f={f{/*/*6/*6/*6/*5/*6*6/*6/*6/*5/*7//*

Expected behavior
No crash

Additional context
https://oss-fuzz.com/testcase-detail/5457878206513152

@tomtau tomtau added the bug label Aug 11, 2022
tomtau pushed a commit to tomtau/pest that referenced this issue Aug 11, 2022
closes pest-parser#686
this logic sneaked in from the previous call depth checking;

the follow up for the grammar timeout issue is pest-parser#685
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant