arcade icon indicating copy to clipboard operation
arcade copied to clipboard

Ensure ownership of ZipEntry stream is clear

Open mmitche opened this issue 5 months ago • 0 comments

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.

mmitche avatar Jul 22 '25 16:07 mmitche