[ 
https://issues.apache.org/jira/browse/COMPRESS-549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17296640#comment-17296640
 ] 

Stefan Bodewig commented on COMPRESS-549:
-----------------------------------------

If you encounter any file that combines a data descriptor with the stored 
method, then your only safe way is to use {{ZipFile}} - either the java.util 
variety or ours. Anything using a non-seekable stream can run into situations 
where reading fails.

> Inconsistency with latest PKZip standard
> ----------------------------------------
>
>                 Key: COMPRESS-549
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-549
>             Project: Commons Compress
>          Issue Type: Bug
>    Affects Versions: 1.20
>            Reporter: Sebastian Kürten
>            Priority: Major
>
> I came across some Zip archives that cannot be read using 
> ZipArchiveInputStream. Investigating the issue, I found that 
> java.util.zip.ZipInputStream from the JDK shows the same behavior while 
> java.util.zip.ZipFile seems to do fine. For java.util.zip.ZipInputStream, the 
> issue has been reported here: 
> [https://bugs.openjdk.java.net/browse/JDK-8143613] and an example file is 
> provided. I copied the testing file into a repository for testing. Here's the 
> example file: 
> [https://github.com/sebkur/test-zip-impls/blob/master/src/test/java/de/topobyte/zip/tests/jdk8143613/TestData.java]
>  and the test that fails reading that data using ZipArchiveInputStream: 
> [https://github.com/sebkur/test-zip-impls/blob/master/src/test/java/de/topobyte/zip/tests/jdk8143613/TestCommonsZipInputStream.java]
>  
>  
> If this file is indeed a ZIP archive consistent with the PKZip spec, I think 
> commons-compress does not work according to the spec. I would appreciate if 
> someone could look into this and verify if this is indeed a bug in 
> commons-compress. Thanks!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to