Skip to content

Trailing zeros in input file causes exception, other zip software can read #890

Open

Description

@RoVaDePi

Describe the bug

We had a bug which made files with lots of trailing zeros, our old zip library had no issue with them but SharpZipLib does. We have since fixed the bug but were wondering if it's possible to read these files with trailing zeros?

Reproduction Code

https://dotnetfiddle.net/iCF2A4

Steps to reproduce

See repro code

Expected behavior

I expected to be able to read the file

Operating System

No response

Framework Version

.NET Framework 4.x

Tags

ZIP

Additional context

No response

Activity

  1. added
    zip
    on Jan 30, 2025
  2. jhudsoncedaron commented on May 8, 2025

    @jhudsoncedaron

    Trailing zeros does in fact make the zip file invalid; you would need to update the size of comment to make it valid again.

  3. SourceproStudio commented on May 8, 2025

    @SourceproStudio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzip

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions