[
https://issues.apache.org/jira/browse/COMPRESS-653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17800904#comment-17800904
]
Zbynek Vyskovsky commented on COMPRESS-653:
-------------------------------------------
Thanks [~ggregory] , good to have such catch!
I fixed this, there are still some style issues I have to look at.
> ZipArchiveOutputStream multi archive updates metadata in incorrect file
> -----------------------------------------------------------------------
>
> Key: COMPRESS-653
> URL: https://issues.apache.org/jira/browse/COMPRESS-653
> Project: Commons Compress
> Issue Type: Bug
> Components: Archivers
> Affects Versions: 1.25.0
> Reporter: Zbynek Vyskovsky
> Priority: Major
>
> `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.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)