Repository: commons-compress Updated Branches: refs/heads/master 785233a6f -> b893471b9
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. Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/0bc43314 Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/0bc43314 Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/0bc43314 Branch: refs/heads/master Commit: 0bc43314c1216a88d0e281e7ed66244c47c57c56 Parents: 785233a Author: dcollin <dcol...@users.noreply.github.com> Authored: Wed Mar 29 13:44:22 2017 +0200 Committer: Stefan Bodewig <bode...@apache.org> Committed: Wed Mar 29 14:20:57 2017 +0200 ---------------------------------------------------------------------- .../commons/compress/archivers/cpio/CpioArchiveInputStream.java | 1 + 1 file changed, 1 insertion(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-compress/blob/0bc43314/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java b/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java index a7059bc..ac4b7bb 100644 --- a/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java +++ b/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java @@ -329,6 +329,7 @@ public class CpioArchiveInputStream extends ArchiveInputStream implements 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;