You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Item with the same key has already been added" extracting tar with duplicate headers #383
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.
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()
Looks like TarExtendedHeaderReader treats every newline as the end of a header, and goes wrong if the value of a header itself contains a newline, rather than just taking the amount of data specified by the length field?
Activity
Numpsy commentedon Sep 15, 2019
I tried debugging it and got:
Looks like TarExtendedHeaderReader treats every newline as the end of a header, and goes wrong if the value of a header itself contains a newline, rather than just taking the amount of data specified by the length field?
piksel commentedon Sep 24, 2019
Whoa, yeah, this seems to be a lot deeper than simply duplicate headers.
piksel commentedon Sep 24, 2019
Adding the file to the issue in case it gets moved: jasmine-data-provider-2.2.0.tar.gz
zarenner commentedon Sep 24, 2019
Thanks for the analysis into the actual cause @Numpsy.