Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Extraction of password-protected Zip files failed.

Aperta
#894 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
csharp
Ambito
backend

Direzione di ricerca

Inizia riproducendo il problema con un Zip protetto da password creato da Bandizip e segui il ciclo di estrazione mostrato nel report, in particolare la lettura dopo che ZipEntry è stato completamente consumato. Il lavoro è completato quando l’estrazione della voce riesce e una lettura successiva restituisce 0 invece di generare “Data descriptor signature not found”.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

*no response* bug
Describe the bug

When other programs (such as Bandizip) compress files into password-protected Zip files, using this library to extract them will throw an exception.
When the 'ZipEntry' is fully read, an exception will be thrown on the next read attempt.
ICSharpCode.SharpZipLib.Zip.ZipException: Data descriptor signature not found

`
// An exception will be thrown here.
while ((ze = zis.GetNextEntry()) != null) {
string filePath = Path.Combine(targetFolderPath, ze.Name);
string directoryPath = Path.GetDirectoryName(filePath) ?? string.Empty;

if (!string.IsNullOrEmpty(directoryPath) && !Directory.Exists(directoryPath)) {
    Directory.CreateDirectory(directoryPath);
}

if (File.Exists(filePath)) {
    File.Delete(filePath);
}

if (!ze.IsDirectory) {
    long nCur = 0; 
    long nLength = zis.Length;
    OnUnZipEntryStart(ze.Name);
    OnUnZipEntryProgress(0, nLength);
    using (FileStream fs = File.Create(filePath)) {
        int sourceBytes;
        do {
            //An exception will be thrown here.
            sourceBytes = zis.Read(data, 0, data.Length);
            nCur += sourceBytes;
            fs.Write(data, 0, sourceBytes);
        } while (sourceBytes > 0);
    }
}

}
`

Reproduction Code

No response

Steps to reproduce

When the 'ZipEntry' is fully read
On subsequent reads, it is theoretically expected to return 0.
But throw ICSharpCode.SharpZipLib.Zip.ZipException: Data descriptor signature not found

Expected behavior

None

Operating System

Windows

Framework Version

.NET Framework 4.x

Tags

No response

Additional context

No response

Lingua principale
C#
Stelle
3.9k
Fork
1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di icsharpcode/SharpZipLib

Tutte le issue di icsharpcode/SharpZipLib

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.