haf / DotNetZip.Semverd

Please use System.IO.Compression! A fork of the DotNetZip project without signing with a solution that compiles cleanly. This project aims to follow semver to avoid versioning conflicts. DotNetZip is a FAST, FREE class library and toolset for manipulating zip files. Use VB, C# or any .NET language to easily create, extract, or update zip files.
Other
545 stars 218 forks source link

Removing an entry from zip archive damages the rest of the files in the archive #206

Open rjfdewit opened 4 years ago

rjfdewit commented 4 years ago

test.zip When removing an AES encrypted file from a zip archive the other files in the archive get corrupted. Testing the file with 7zip reports a CRC error. The original zip file was created using the exceed .net zip library, extracting files from that original file is no problem. After removing 1 file from the original the characteristics of the other entries are changed from "0x554E NTFS up WzAES : Encrypt" to "WzAES NTFS : Encrypt".

Find an example zip file, build with xceed zip library in the attachment of this issue. The zip file contains 2 files test1.txt en test2.txt. When removing 1 of the files with this code the other file cannot extracted anymore. Password for the files in the zip is test.

using (var f = Ionic.Zip.ZipFile.Read("test.zip")) { f.RemoveEntry("test1.txt"); f.Save(); }