ZipFile.TestArchive() returns true for empty file
まだ誰も着手していません。
評価
調査の方向性
ZipFile.TestArchive から開始し、ZipFile 経由で開いたときに空のストリームがどのように処理されるかを追跡します。空の名前変更された .txt ストリームの回帰テストを追加し、その後、空でないファイルについて報告される動作のカバレッジを維持したまま、TestArchive が false を返すことを確認します。
索引モデルが issue の本文から書いたものです。
説明
Steps to reproduce
- Create Empty *.txt file and rename extension to *.zip
- Use OpenReadStream() and TestArchive(true, TestStrategy.FindFirstError, null)
Expected behavior
The method must return false
Actual behavior
Method returns true
Version of SharpZipLib
1.3.3
Obtained from (only keep the relevant lines)
- Package installed using NuGet
Notably, the method returns false if there is any information in the text file
My code:
public static bool IsCorrectZipFile(this IFormFile zipFile) //zipFile = emptyTxtFile.zip
{
try
{
bool result;
using (ZipFile zip = new ZipFile(zipFile.OpenReadStream()))
{
result = zip.TestArchive(true, TestStrategy.FindFirstError, null);
}
return result;
}
catch
{
return false;
}
}
- 主要言語
- 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
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
bug needs response
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Adyen/adyen-dotnet-api-library#1869 ·
-
Status: Needs Triage Type: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
bug effort:S P3
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
nightscout/nocturne#1602 ·