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

CPIO crc overflow resolved for large files #17

Closed
wants to merge 1 commit into from

Conversation

dcollin
Copy link
Contributor

@dcollin dcollin commented Mar 29, 2017

When unpacking a CPIO file containing a large file the crc check will
overflow and throw an IOException("CRC Error...").

Did not find a nice way to test this since it requires a very large
input file.

When unpacking a CPIO file containing a large file the crc check will
overflow and throw an IOException("CRC Error...").

Did not find a nice wa to test this since it requires a very lasrge
input file.
@coveralls
Copy link

coveralls commented Mar 29, 2017

Coverage Status

Coverage increased (+0.001%) to 84.176% when pulling dd1ec97 on dcollin:crc_fix into 785233a on apache:master.

@bodewig
Copy link
Member

bodewig commented Mar 29, 2017

Great, many thanks,

I've just found https://people.freebsd.org/~kientzle/libarchive/man/cpio.5.txt states

The CRC format is identical to the new ASCII format described in the previous section except that the magic field is set to ``070702'' and the check field is set to the sum of all bytes in the file data. This sum is computed treating all bytes as unsigned values and using unsigned arithmetic. Only the least-significant 32 bits of the sum are stored.

so your patch is certainly correct.

I'm afraid we've got the same bug when writing CPIO archives. I'll take care of it.

@asfgit asfgit closed this in 44d376b Mar 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants