This repository was archived by the owner on May 15, 2024. It is now read-only.
Bugfix in OffsetStream.Seek for reading embedded zip archives#283
Open
Anlo2846 wants to merge 2 commits intohaf:masterfrom
Open
Bugfix in OffsetStream.Seek for reading embedded zip archives#283Anlo2846 wants to merge 2 commits intohaf:masterfrom
Anlo2846 wants to merge 2 commits intohaf:masterfrom
Conversation
Ionic.Zip.ZipException
HResult=0x80131500
Message=Cannot read that as a ZipFile
Source=DotNetZip
StackTrace:
at Ionic.Zip.ZipFile.ReadIntoInstance(ZipFile zf) in DotNetZip.Semverd\src\Zip.Shared\ZipFile.Read.cs:line 660
at Ionic.Zip.ZipFile.Read(Stream zipStream, TextWriter statusMessageWriter, Encoding encoding, EventHandler`1 readProgress) in DotNetZip.Semverd\src\Zip.Shared\ZipFile.Read.cs:line 543
at Ionic.Zip.ZipFile.Read(Stream zipStream) in DotNetZip.Semverd\src\Zip.Shared\ZipFile.Read.cs:line 414
at Ionic.Zip.Tests.Streams.StreamsTests.ReadZip_WithOffset() in DotNetZip.Semverd\src\Zip Tests\Streams.cs:line 225
This exception was originally thrown at this call stack:
Ionic.Zip.ZipFile.ReadCentralDirectoryFooter(Ionic.Zip.ZipFile) in ZipFile.Read.cs
Ionic.Zip.ZipFile.ReadCentralDirectory(Ionic.Zip.ZipFile) in ZipFile.Read.cs
Ionic.Zip.ZipFile.ReadIntoInstance(Ionic.Zip.ZipFile) in ZipFile.Read.cs
Inner Exception 1:
BadReadException: Bad signature (0000002C) at position 0x00000082
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When reading a zip archive embedded in another file, we get a BadReadException: "Bad signature at position [...]".
This is due to a bug in OffsetStream.Seek().
_originalPosition should only be added to the offset when origin == SeekOrigin.Begin.