[
https://issues.apache.org/jira/browse/COMPRESS-268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stefan Bodewig resolved COMPRESS-268.
-------------------------------------
Resolution: Duplicate
Fix Version/s: 1.8
fixed in svn, 1.8 will be released soonish.
Thanks
> Buffer not read first time for entries with STORED compression method
> ---------------------------------------------------------------------
>
> Key: COMPRESS-268
> URL: https://issues.apache.org/jira/browse/COMPRESS-268
> Project: Commons Compress
> Issue Type: Bug
> Components: Archivers
> Affects Versions: 1.7
> Environment: * Fedora 20 x64
> * Java 1.7.0_51 x64
> * archive created with Nautilus' context menu
> Reporter: Radu Almășan
> Labels: archive, zip
> Fix For: 1.8
>
> Attachments: test.zip
>
>
> Trying to extract a ZIP archive that contains entries with {{STORED}}
> compression method, the {{ZipArchiveInputStream.readStored(byte[], int,
> int)}} method is called. At this point, because the {{buf}} array has not had
> a chance to be populated with values from the underlying input stream and
> because there's no condition to detect this, the resulting content is
> prefixed with the buffer's length (512) of 0 bytes.
> I've found that chancing:
> bq. if (buf.position() >= buf.limit()) {
> with
> bq. if (buf.position() >= buf.limit() || current.bytesReadFromStream == 0) {
> solves the issue.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)