Marti2203 opened a new pull request, #845: URL: https://github.com/apache/commons-compress/pull/845
Fixes [COMPRESS-734](https://issues.apache.org/jira/browse/COMPRESS-734). `SevenZOutputFile` ignored the return value of `SeekableByteChannel.write(ByteBuffer)` at all five write sites, while still counting every byte in the CRC and `fileBytesWritten`. A channel that writes fewer bytes than are remaining, which the `WritableByteChannel` contract allows, therefore produced a corrupt archive without any error. This adds a `writeFully` loop, the same as `ZipIoUtil.writeAll` for ZIP, and uses it for every write. `SevenZOutputFileTest.testPartialChannelWrites` writes through a channel that accepts at most 1 KiB per call and reads the archive back: without the change reading fails with "packSize (100,100) is out of range"; with it the content matches. `SevenZOutputFileTest` (36 tests) and `mvn -B -DskipTests -DskipITs` pass. This issue was found by an LLM-Enhanced Static Analysis Engine and verified manually. The patch and this description were prepared with AI assistance (Claude Code) and reviewed by me; the commit carries an `Assisted-By:` trailer. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
