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

more clear API documentation for ar_parse_entry failed situation ? #6

Open
comicfans opened this issue May 9, 2019 · 1 comment
Open

Comments

@comicfans
Copy link
Contributor

Hello, while fuzzing unarr I've found that if ar_parse_entry failed, archive entry_offset_next will never be increased , so that means it can not 'skip' the bad entry and continue to end, is this expected behavior ? maybe better to add description for this situation to header comment.

@selmf
Copy link
Owner

selmf commented May 9, 2019

Yes, this is expected behaviour. In many cases when the entry header is corrupted, it no longer is possible to calculate the address of the next entry.
We could try to locate the next entry by searching for its header signature (using memcmp, for example), but this isn't implemented yet and only works for non-solid compressions. In case of solid compressions, decompression of an entry depends on the decompression dictionary left by the previous entry, so if one entry is corrupt all entries after that can no longer be decompressed.

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

No branches or pull requests

2 participants