[Bug report][Regression] Extra "garbage" added when extracting single huge file #496

Open
opened 2026-01-29 22:12:54 +00:00 by claunia · 1 comment
Owner

Originally created by @EmilBode on GitHub (Feb 15, 2022).

I'm sorry I can't give a fully reproducible example, as I've only encountered this bug in confidential data. Maybe others can weigh in.

Issue
When extracting a single file out of a zip-archive, sometimes the extracted file gets extra garbage added at the end.

Commonalities
This happens in several files, but they are much alike:

  • All zipfiles are Zip64-compressed
  • All zipfiles have extra data after the real payload. This is expected (due to the source), but can be ignored.
  • All of the zipfiles are huge, the smallest is just under 64GB
  • The file to be extracted is also quite large, >4 GB in all cases

The issue only happens with SharpCompress 0.30.0, but extracting with 0.26.0 works fine.

Originally created by @EmilBode on GitHub (Feb 15, 2022). I'm sorry I can't give a fully reproducible example, as I've only encountered this bug in confidential data. Maybe others can weigh in. **Issue** When extracting a single file out of a zip-archive, sometimes the extracted file gets extra garbage added at the end. **Commonalities** This happens in several files, but they are much alike: - All zipfiles are Zip64-compressed - All zipfiles have extra data after the real payload. This is expected (due to the source), but can be ignored. - All of the zipfiles are huge, the smallest is just under 64GB - The file to be extracted is also quite large, >4 GB in all cases The issue only happens with SharpCompress 0.30.0, but extracting with 0.26.0 works fine.
claunia added the bugup for grabs labels 2026-01-29 22:12:54 +00:00
Author
Owner

@adamhathcock commented on GitHub (Feb 16, 2022):

There was probably some adjustment of a bug or logic.

Though, I'm interested in your second point wondering how valid a zip file it is. Maybe it's allowed by spec but just something most people don't encounter?

@adamhathcock commented on GitHub (Feb 16, 2022): There was probably some adjustment of a bug or logic. Though, I'm interested in your second point wondering how valid a zip file it is. Maybe it's allowed by spec but just something most people don't encounter?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#496