Reading deflate file throw "Unexpected EOF"
还没有人认领这个 Issue。
评估
调研方向
从 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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 ·
-
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
难度 1/5 1 小时以内 新手友好度 90/100
-
Type: enhancement
难度 2/5 1-3 小时 新手友好度 65/100
apache/arrow-adbc#4809 ·
-
type/automation type/tech-debt
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 65/100
microsoft/vscode-azurefunctions#5197 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 85/100
microsoft/microsoft-ui-reactor#1274 ·