Skip to content

ZipArchive should report better error message for empty or invalid stream #136215

Closed

Description

@huoyaoyuan

Currently, creating ZipArchive on an empty stream throws exception message with "Central Directory corrupt". I met this when I was doing HTTP request incorrectly and got an empty response. This can lead to confusion for whether the requested file is corrupt.

The suggestion is to add dedicated error messages for:

  • The stream is empty
  • The stream doesn't have the expected magic word

This can help for locating the problem when the stream comes from non-file cases.

Activity

  1. added
    untriaged
    on Oct 21, 2026
  2. dotnet-policy-service commented on Oct 21, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @karelz, @dotnet/area-system-io-compression
    See info in area-owners.md if you want to be subscribed.

  3. removed
    untriaged
    on Oct 29, 2026
  4. iremyux commented on Oct 29, 2026

    @iremyux
    Contributor

    We will look into it in .NET12 timeline.

  5. added this to the 12.0.0 milestone on Oct 29, 2026
  6. self-assigned this
    on Nov 3, 2026
  7. added a commit that references this issue on Nov 13, 2026
    c5b176e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions