mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 13:34:59 +00:00
Rar.UnpackV1.Unpack.window is being used without initialized even when archive is solid #554
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?
Originally created by @RigoLigoRLC on GitHub (Dec 17, 2022).
I'm a contributor to OpenUtau (a SharpCompress user open source software) and was debugging an issue where some RAR archives can crash the app.
Application code from OpenUtau (that is crashing):
With help of dnSpy I can trace it down and single step to find this statement that causes an exception in

Rar.UnpackV1.Unpack.Unpack29:I know nothing about SharpCompress' internals and how RAR decompressing works but basically the code tells me that if the archive is solid then the
windowmember is not initialized:Now that this archive apparently violated this rule.
Stack trace (from OpenUtau):
Archive causing the failure: Mediafire
@adamhathcock commented on GitHub (Dec 20, 2022):
The issue here is that this is a SOLID archive.
In RAR, you cannot randomly access a SOLID archive like a normal archive. Therefore, you should use the RarReader/ReaderFactory interface and treat it as a forward-only stream.
https://documentation.help/WinRAR/HELPArcSolid.htm
This detection is RAR specific and isn't available in the generic usage. I probably should have a more specific exception instead of having that random null exception