Skip to content

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