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

parser: fix index out of bounds error #4484

Merged
merged 5 commits into from
Mar 12, 2023

Conversation

papparapa
Copy link
Contributor

Fixes #4479

This PR fixes index out of bounds in parse_glob::fix_negation.

@github-actions
Copy link

github-actions bot commented Mar 9, 2023

GNU testsuite comparison:

Congrats! The gnu test tests/tail-2/inotify-dir-recreate is no longer failing!
GNU test failed: tests/misc/timeout. tests/misc/timeout is passing on 'main'. Maybe you have to rebase?

@sylvestre
Copy link
Contributor

Could you please add a test to make sure we don't regress in the future?

@sylvestre
Copy link
Contributor

(thanks ;)

@tertsdiepraam
Copy link
Member

tertsdiepraam commented Mar 9, 2023

Great find! In addition to the test, could you add a comment explaining what the offset is for?

@sylvestre
Copy link
Contributor

I landed the fuzzers and rebuild on top of this PR and we are getting:

thread '<unnamed>' panicked at 'index out of bounds: the len is 11 but the index is 11', /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/uucore-0.0.17/src/lib/parser/parse_glob.rs:14:54

@papparapa
Copy link
Contributor Author

Added a comment and a test.

@sylvestre

I landed the fuzzers and rebuild on top of this PR and we are getting:

thread '<unnamed>' panicked at 'index out of bounds: the len is 11 but the index is 11', /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/uucore-0.0.17/src/lib/parser/parse_glob.rs:14:54

Did it use the old file in cargo registry?

@sylvestre
Copy link
Contributor

yeah, i guess it was the issue
i saw that you are not using the workspace too (i did it here too: #4495 )
it is clearly fixed:
https:/uutils/coreutils/actions/runs/4384176388/jobs/7675329815
Done 1439932 runs in 61 second(s)
bravo

@sylvestre sylvestre merged commit e5b6f63 into uutils:main Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

parse_glob function fuzzing fails quickly on index out of bounds: the len is 4 but the index is 4
3 participants