dotnet / dotnet/arcade

Ensure ownership of ZipEntry stream is clear

Open
#15,985 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
729
Forks
397
Avg merge
3d 15m
Merged PRs (30d)
149

Description

In SignTool's archive handling (which handles more than Zips!), the ZipEntry contructor is handed a content stream for use in computing the content hash. This stream is then assigned to a member of the ZipEntry if it is seekable, or copied to another stream and then assigned if it is not. There are a number of places where a caller (mostly/all in a ZipData.ReadEntries loop) that reaches the ZipData constructor is passing a stream with a `using`.

Ownership of the passed-in stream needs to be clear. ZipData should own the stream that is passed to it, and any streams that it creates.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.