Description
`ZipArchiveOutputStream` fails to update metadata (compressed size, CRC) when file is split into multiple archives. The original stream is closed and the metadata is written into currently open channel instead.
Such archive is then not possible to process with regular zip utility as metadata is incorrect and the data stream may be broken because of incorrectly overwritten content by metadata.
The issue is in `rewriteSizesAndCrc()` function which uses currently open channel.
When `addRawArchiveEntry()` and metadata is populated in advance, the produced archive is correct.
Full fix is more complicated as the archiver needs to keep multiple channels open. As a quick fix, throwing unsupported operation exception may be sufficient to avoid silent failure.
Attachments
Issue Links
- links to