TarArchive.Open cause app crach #719

Closed
opened 2026-01-29 22:16:24 +00:00 by claunia · 1 comment
Owner

Originally created by @fuxuejun on GitHub (Nov 12, 2025).

Originally assigned to: @Copilot on GitHub.

when I use code to compress a tar file :
var options = new ReaderOptions();
options.ArchiveEncoding.Default = Encoding.Default;
var archive = TarArchive.Open(ms, options);

it will crashed, and throw exception:

at System.ThrowHelper.ThrowEndOfFileException + 0x5(Unknown Source)
at System.IO.Stream.ReadAtLeastCore + 0x19(Unknown Source)
at System.IO.Stream.ReadExactly + 0x9(Unknown Source)
at System.IO.BinaryReader.InternalRead + 0x26(Unknown Source)
at System.IO.BinaryReader.ReadUInt32 + 0xb(Unknown Source)
at SharpCompress.Compressors.ZStandard.ZStandardStream.IsZStandard + 0x6(Unknown Source)
at SharpCompress.Readers.Tar.TarReader.Open + 0xae(Unknown Source)
at SharpCompress.Archives.Tar.TarArchive.CreateReaderForSolidExtraction + 0x18(Unknown Source)
at SharpCompress.Archives.AbstractArchive`2.ExtractAllEntries + 0x6(Unknown Source)

Originally created by @fuxuejun on GitHub (Nov 12, 2025). Originally assigned to: @Copilot on GitHub. when I use code to compress a tar file : var options = new ReaderOptions(); options.ArchiveEncoding.Default = Encoding.Default; var archive = TarArchive.Open(ms, options); it will crashed, and throw exception: at System.ThrowHelper.ThrowEndOfFileException + 0x5(Unknown Source) at System.IO.Stream.ReadAtLeastCore + 0x19(Unknown Source) at System.IO.Stream.ReadExactly + 0x9(Unknown Source) at System.IO.BinaryReader.InternalRead + 0x26(Unknown Source) at System.IO.BinaryReader.ReadUInt32 + 0xb(Unknown Source) at SharpCompress.Compressors.ZStandard.ZStandardStream.IsZStandard + 0x6(Unknown Source) at SharpCompress.Readers.Tar.TarReader.Open + 0xae(Unknown Source) at SharpCompress.Archives.Tar.TarArchive.CreateReaderForSolidExtraction + 0x18(Unknown Source) at SharpCompress.Archives.AbstractArchive`2[[SharpCompress.Archives.Tar.TarArchiveEntry, SharpCompress, Version=0.41.0.0, Culture=neutral, PublicKeyToken=afb0a02973931d96],[SharpCompress.Common.Tar.TarVolume, SharpCompress, Version=0.41.0.0, Culture=neutral, PublicKeyToken=afb0a02973931d96]].ExtractAllEntries + 0x6(Unknown Source)
claunia added the bug label 2026-01-29 22:16:24 +00:00
Author
Owner

@adamhathcock commented on GitHub (Nov 29, 2025):

Fixed in 0.42.0

@adamhathcock commented on GitHub (Nov 29, 2025): Fixed in 0.42.0
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#719