Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Reading deflate file throw "Unexpected EOF"

オープン
#837 コメント 24 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp
領域
backend

調査の方向性

InflaterInputStream.Read から始め、添付された data.zip と issue に示されているコンソールアプリケーションを使って失敗を再現します。unexpected EOF が発生する箇所を追跡し、その後、この入力の読み取りが例外なしで完了することを確認して、再現したケースのカバレッジを追加します。

索引モデルが issue の本文から書いたものです。

説明

Describe the bug

Hello community,

i am not really firm with deflate compremissed files but with the attached file (data.zip) i get a unexpeced EOF exception from the InflaterInputStream class. It is reproducible with the following code at line var size = _inflater.Read(data, 0, data.Length);

using (var input = new FileStream(@"data4.bin", FileMode.Open))
{
  using (var output = new MemoryStream(65536))
  {
    using (var _inflater = new InflaterInputStream(input))
    {
      var data = new byte[4096];

      while (true)
      {
        data = new byte[4096];

        var size = _inflater.Read(data, 0, data.Length);

        if (size > 0)
        {
          output.Write(data, 0, size);
        }
        else
        {
          break;
        }
      }
    }
  }
}

Best regards
Daniel

Reproduction Code

No response

Steps to reproduce

Create a console app, add the latest release as nuget package of SharpZipLib and run the above code.

Expected behavior

It should not throw a exception

Operating System

Windows

Framework Version

No response

Tags

No response

Additional context

No response

主要言語
C#
スター
3.9k
フォーク
1k
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

icsharpcode/SharpZipLib のほかの issue

icsharpcode/SharpZipLib の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。