mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-09 21:24:08 +00:00
[PR #894] [MERGED] Fix condition in rar v3 code #1315
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/adamhathcock/sharpcompress/pull/894
Author: @Morilli
Created: 2/11/2025
Status: ✅ Merged
Merged: 2/11/2025
Merged by: @adamhathcock
Base:
master← Head:fix-rare-solid-rar-failure📝 Commits (4)
94789ceFix condition in rar v3 code04b2501Merge branch 'master' into fix-rare-solid-rar-failurea77c03fadd comment and change the same code in new Unpack50eb5db17revert change to rar5 code📊 Changes
1 file changed (+4 additions, -2 deletions)
View changed files
📝
src/SharpCompress/Compressors/Rar/UnpackV1/Unpack.cs(+4 -2)📄 Description
This was an interesting one to track down. Basically, when
UnpWriteDatais called with a size of0, it must callwriteStream.Writeeven ifdestUnpSizeis 0 to ensure thatSuspendedis set to false.The same condition change must be done here:
94789ce455/src/SharpCompress/Compressors/Rar/UnpackV1/Unpack.cs (L266)to make sure that the code passes over both
if (destUnpSize < 0)andif (suspended)conditions and continues below.While investigating this bug I found some other issues in the rarVM code, but I'm not sure how to test them and whether that code is even still used nowadays.
TODO: Find some example archive that shows this bug that isn't 40MB and add a test case for it.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.