Using Reader to extract Uncompressed Zips created in a Streaming manner #373

Open
opened 2026-01-29 22:10:49 +00:00 by claunia · 8 comments
Owner

Originally created by @Poolitzer80 on GitHub (Sep 8, 2019).

Samplecode.txt
I have a zip file zipped by OneDrive. When i call the ExtractAllFiles method and i iterate through the files (the zip has 4 files) a EndOfStream Exception is thrown after the first entry.

I attached the File and some sampleCode to Test it with NUnit
OneDrive.zip

Originally created by @Poolitzer80 on GitHub (Sep 8, 2019). [Samplecode.txt](https://github.com/adamhathcock/sharpcompress/files/3587678/Samplecode.txt) I have a zip file zipped by OneDrive. When i call the ExtractAllFiles method and i iterate through the files (the zip has 4 files) a EndOfStream Exception is thrown after the first entry. I attached the File and some sampleCode to Test it with NUnit [OneDrive.zip](https://github.com/adamhathcock/sharpcompress/files/3587680/OneDrive.zip)
claunia added the bugwontfix labels 2026-01-29 22:10:49 +00:00
Author
Owner

@Erior commented on GitHub (Apr 22, 2020):

It is a streamed file using no compression, it works in the latest version as far as I can see.

@Erior commented on GitHub (Apr 22, 2020): It is a streamed file using no compression, it works in the latest version as far as I can see.
Author
Owner

@MartinDemberger commented on GitHub (Jun 15, 2022):

In the new version (0.32.0) this leads to a endless loop.

@MartinDemberger commented on GitHub (Jun 15, 2022): In the new version (0.32.0) this leads to a endless loop.
Author
Owner

@adamhathcock commented on GitHub (Jun 15, 2022):

hopefully someone can take a look soon

@adamhathcock commented on GitHub (Jun 15, 2022): hopefully someone can take a look soon
Author
Owner

@adamhathcock commented on GitHub (Jun 20, 2022):

https://www.nuget.org/packages/SharpCompress/0.32.1

@adamhathcock commented on GitHub (Jun 20, 2022): https://www.nuget.org/packages/SharpCompress/0.32.1
Author
Owner

@adamhathcock commented on GitHub (Jul 26, 2022):

Might have to revert this....logically, I'm not sure this is something to account for:

For an uncompressed file:

  • we don't know where the file stream ends (compressed files we do, ironically, because the compression knows when it's done)
  • and we don't have a size on a streaming file because it's in the trailer.
@adamhathcock commented on GitHub (Jul 26, 2022): Might have to revert this....logically, I'm not sure this is something to account for: For an uncompressed file: - we don't know where the file stream ends (compressed files we do, ironically, because the compression knows when it's done) - and we don't have a size on a streaming file because it's in the trailer.
Author
Owner

@Erior commented on GitHub (Jul 28, 2022):

Because we don't search for DataDescriptors for not compressed streams or give reader info of sizes from DirectoryHeaders.
Created #686 to fix/show where we need things

@Erior commented on GitHub (Jul 28, 2022): Because we don't search for DataDescriptors for not compressed streams or give reader info of sizes from DirectoryHeaders. Created #686 to fix/show where we need things
Author
Owner

@Erior commented on GitHub (Jul 28, 2022):

Did a small implementation for seeking non compressed streams, with some limitations...
missing crc32 check, missing 64bit handling, but do check that skipped size matches.

@Erior commented on GitHub (Jul 28, 2022): Did a small implementation for seeking non compressed streams, with some limitations... missing crc32 check, missing 64bit handling, but do check that skipped size matches.
Author
Owner

@adamhathcock commented on GitHub (Jul 29, 2022):

still have a problem with nested non-compressed zips but I'm starting to look my patence for these kinds of issues. Scanning ahead for the post data descriptor all that can be done for now

@adamhathcock commented on GitHub (Jul 29, 2022): still have a problem with nested non-compressed zips but I'm starting to look my patence for these kinds of issues. Scanning ahead for the post data descriptor all that can be done for now
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#373