GetNextEntryAsync might use too large buffer
まだ誰も着手していません。
評価
調査の方向性
src/ICSharpCode.SharpZipLib/Tar/TarInputStream.cs の2か所のヘッダーバッファー割り当て箇所から始め、次に TarBuffer.ReadBlockIntAsync() とその正確な長さのチェックを調べます。TAR 入力で動作を検証し、ArrayPool が BlockSize より大きいバッファーを返した場合に GetNextEntryAsync が例外なく完了することを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
For TAR files GetNextEntryAsync tries to allocates a byte[] buffer of BlockSize 512, using .Rent():
But .Rent() returns at least the requested size.
After this, in TarBuffer.ReadBlockIntAsync() checkes if buffer size is exactly the same as the requested BlockSize.
if (buffer.Length != BlockSize)
{
throw new ArgumentException("BUG: buffer must have length BlockSize");
}
Sometimes headerBuf becomes larger than the requested TarBuffer.BlockSize (in my case 1024) and the ArgumentException("BUG: buffer must have length BlockSize") is thrown.
Possible fix:
if (buffer.Length < BlockSize)
{
throw new ArgumentException("BUG: buffer must have length BlockSize");
}
Reproduction Code
No response
Steps to reproduce
N/A
Expected behavior
No exception for larger buffers
Operating System
No response
Framework Version
No response
Tags
No response
Additional context
No response
- 主要言語
- C#
- スター
- 3.9k
- フォーク
- 1k
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
icsharpcode/SharpZipLib のほかの issue
-
*no response* bug
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
icsharpcode/SharpZipLib#905 · コメント 1 件 ·
-
bug bzip2
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
icsharpcode/SharpZipLib#904 ·
-
SetLevel in ZipFile オープンenhancement zip
難易度 2/5 1〜2日 初心者へのやさしさ 55/100
icsharpcode/SharpZipLib#903 ·
-
*no response* bug
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
icsharpcode/SharpZipLib#901 · コメント 1 件 ·
-
*no response* bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
icsharpcode/SharpZipLib#894 · コメント 1 件 ·
icsharpcode/SharpZipLib の issue をすべて見る
似ている issue
-
bug frontend good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
NavigationViewItemAutomationPeer implements IInvokeProvider but never advertises the Invoke pattern オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
unoplatform/uno#24629 ·
-
agentic-workflows Needs: Triage :mag: State: In-PR
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
Type: enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
apache/arrow-adbc#4809 ·