Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Exception when reading an encrypted zip file containing a folder: "Stored, but compressed != uncompressed"

Đang mở
#885 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp
Lĩnh vực
tooling

Hướng nghiên cứu

Bắt đầu bằng cách chạy bản tái hiện .NET 7 được liên kết với archive đính kèm và kiểm tra ZipInputStream.GetNextEntry() trong khi xử lý các entry thư mục được mã hóa. Hoàn tất khi các entry trong archive được liệt kê mà không gặp exception “Stored, but compressed != uncompressed”, với coverage cho bản tái hiện này.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug zip
Describe the bug

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);
}
Reproduction Code

https://dotnetfiddle.net/fXUXgR

Steps to reproduce
  1. Download the attached zip file and edit the provided code to point to that file.
  2. Run the code.
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

Ngôn ngữ chính
C#
Star
3.9k
Fork
1k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của icsharpcode/SharpZipLib

Tất cả issue của icsharpcode/SharpZipLib

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.