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

Return error when record is too short #5

Closed
wants to merge 2 commits into from

Conversation

5225225
Copy link

@5225225 5225225 commented Jan 16, 2022

Fixes #2

I'm not entirely sure this is the best way to fix this, but the check needed to have been done up in NtfsFile because everything below it (in the process of getting the signature) is infalliable.

I also don't like the vec![0; record_size] there, looks like a malformed file system can cause an OOM. Granted, it's a u32 so that might still be fine on some platforms, but definitely not on embedded. Best thing to do there would be to validate that the stream length is actually long enough to fit the given record size

@5225225 5225225 marked this pull request as ready for review January 26, 2022 21:30
@5225225
Copy link
Author

5225225 commented Jan 26, 2022

The code here works barring the comments in the PR that I'm not sure about. Feel free to close this PR and adapt the code in a new one (Or just push to this one)

@5225225
Copy link
Author

5225225 commented May 18, 2022

Closing since it looks like #2 was fixed

@5225225 5225225 closed this May 18, 2022
@5225225 5225225 deleted the slice-oob branch May 18, 2022 13:17
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.

Slice index out of bounds when parsing upcase table for malformed FS
1 participant