-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Description
SharpZipLib fails to process a tar file that contains duplicate extended headers. Other tar programs (e.g. tar, 7-zip, SharpCompress) appear to handle this fine.
Steps to reproduce
- Download https://registry.npmjs.org/jasmine-data-provider/-/jasmine-data-provider-2.2.0.tgz
- gunzip (either with sharpziplib or other software)
- Attempt to extract, read entries, or list contents of the tar:
using (var fs = File.OpenRead("c:\\jasmine-data-provider-2.2.0.tar"))
using (TarArchive tar = TarArchive.CreateInputTarArchive(fs))
{
tar.ListContents();
}Actual behavior
An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at ICSharpCode.SharpZipLib.Tar.TarExtendedHeaderReader.Read(Byte[] buffer, Int32 length) at ICSharpCode.SharpZipLib.Tar.TarInputStream.GetNextEntry() at ICSharpCode.SharpZipLib.Tar.TarArchive.ListContents()
Version of SharpZipLib
1.2.0
Obtained from (only keep the relevant lines)
- Package installed using NuGet