arcade
arcade copied to clipboard
Ensure ownership of ZipEntry stream is clear
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.