Skip to content

ExtractContent() of a corrupt file holds the extracting file open #321

@sslyle

Description

@sslyle

Steps to reproduce

  1. zip a file, open the .zip file in Notepad++, intention delete the second half of the file.
  2. Create a folder and ExtractContent() into the new folder.
  3. Try to delete the file (being a developer you want to clean up after yourself don't you?)

Expected behavior

will be successfully deleted

Actual behavior

ExtractContent() throws "Unexpected EOF"
You can then .Close() the TarArchive, even .Dispose() but your code still has the file open and it can't be deleted. Not even from Windows File Explorer.
Neither can you delete the folder you just created to unzip the archive into.
You can not clean up after attempting to unzip a corrupted archive file

Version of SharpZipLib

(1.0.0)

Obtained from (only keep the relevant lines)

  • Compiled from source, commit: _______ - N/A
  • Downloaded from GitHub - NO
  • Package installed using NuGet - YES

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions