You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use a ZipInputStream to read a zip file that is encrypted and contains folder entries, the following exception occurs:
ICSharpCode.SharpZipLib.Zip.ZipException: 'Stored, but compressed != uncompressed'
Here is the zip file that is causing the exception. It was created using SharpZipLib and can be opened fine using other zip applications or libraries: archive.zip
In the code below, it fails when calling GetNextEntry():
using var archive = new ZipInputStream(File.OpenRead(archiveFilePath))
{
Password = "123456"
};
ZipEntry entry;
while ((entry = archive.GetNextEntry()) != null)
{
Console.WriteLine(entry.Name);
}
Describe the bug
When I use a
ZipInputStream
to read a zip file that is encrypted and contains folder entries, the following exception occurs:Here is the zip file that is causing the exception. It was created using SharpZipLib and can be opened fine using other zip applications or libraries:
archive.zip
In the code below, it fails when calling
GetNextEntry()
:Reproduction Code
https://dotnetfiddle.net/fXUXgR
Steps to reproduce
Expected behavior
The program must list the entries in the zip file without throwing an exception.
Operating System
Windows
Framework Version
.NET 7
Tags
ZIP
Additional context
No response
The text was updated successfully, but these errors were encountered: