Description
src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java contains the following at line 380 in getMergedFields():
zipExtraFields[zipExtraFields.length] = unparseableExtra;
This will cause an ArrayIndexOutOfBoundsException when reached.
Note that Apache Ant inherited this bug with commit 2c04d7e, which is where I found it; a fix should be ported there too. (The class is called just ZipEntry there; full path: src/main/org/apache/tools/zip/ZipEntry.java)
The correct line is probably one of the following:
zipExtraFields[zipExtraFields.length - 1] = unparseableExtra; zipExtraFields[extraFields.length] = unparseableExtra;
They should be equivalent because of the line immediately above line 380, which creates zipExtraFields as copy of extraFields that is one element longer. It might be worth noting that line 411 of ZipArchiveEntry uses zipExtraFields.length - 1, while line 411 of Ant's ZipEntry uses extraFields.length.