CPIO crc overflow resolved for large files
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.
@@ -329,6 +329,7 @@ public int read(final byte[] b, final int off, final int len)
if (this.entry.getFormat() == FORMAT_NEW_CRC) {
for (int pos = 0; pos < tmpread; pos++) {
this.crc += b[pos] & 0xFF;
+ this.crc &= 0xFFFFFFFFL;
}
}
this.entryBytesRead += tmpread;
