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

Fix --dump-toc-raw option #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

robertknight
Copy link

This option was reading the correct number of bytes but
from the wrong starting offset within the xar file.

The --dump-toc-raw option always read at least the
first sizeof(xar_header_ex_t) bytes from the file before
reading header.toc_length_compressed bytes of data for
the TOC header.

However, sizeof(xar_header_ex_t) is the maximum possible
size of the header. The minimum size is sizeof(xar_header_t).
The option then reads any additional bytes needed to position
the fd at header.size bytes from the beginning of the file.

This option was reading the correct number of bytes but
from the wrong starting offset within the xar file.

The --dump-toc-raw option always read at least the
first sizeof(xar_header_ex_t) bytes from the file before
reading header.toc_length_compressed bytes of data for
the TOC header.

However, sizeof(xar_header_ex_t) is the _maximum_ possible
size of the header. The minimum size is sizeof(xar_header_t).
The option then reads any additional bytes needed to position
the fd at header.size bytes from the beginning of the file.
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.

1 participant