asyncbuffer: a completed JPEG read can return EOF before its first byte
还没有人认领这个 Issue。
评估
调研方向
阅读 asyncbuffer/buffer.go,重点关注 AsyncBuffer.offsetAvailable 及其字节数、完成和 EOF 检查的顺序。使用 issue 生成的 JPEG 和内存读取器复现竞态,然后调整检查顺序,使已完成的缓冲区在返回 EOF 前重新检查。完成的标准是:当源在初始字节数检查与完成检查之间结束时,JPEG 检测能够成功。
由索引模型根据 Issue 内容生成。
描述
A valid JPEG can be classified as 422 Invalid source image if the background download finishes between the byte-count check and the completion check in AsyncBuffer.offsetAvailable. I reproduced it with a generated 60×1200 JPEG and an in-memory reader; no storage backend or network is needed.
Version: v4.0.24 (reproduced); v4.0.25 has the identical asyncbuffer/buffer.go. The same check order is still present on master (c8c5d1a5).
Reproduce: Block the underlying reader before its first read. Start imagetype.Detect on AsyncBuffer.Reader() with image/jpeg. At offset 0, pause immediately after the byte-count check reports no bytes. Unblock the stream, wait for the buffer to finish, and resume at the finished/EOF check.
Expected: Detect JPEG; the finished buffer contains the complete input. Actual: EOF at offset 0; format detection reports 422 Invalid source image with all 1,827 bytes buffered and no stream error. The same bytes detect directly as JPEG. Rechecking the byte count after observing finished makes the same forced ordering detect JPEG.
- 主要语言
- Go
- 星标
- 11.1k
- 派生
- 777
- 平均合并
- 9 小时 37 分钟
- 30 天内合并 PR
- 2
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
imgproxy/imgproxy 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 38/100
-
难度 4/5 3-5 天 新手友好度 52/100
-
难度 3/5 1-2 天 新手友好度 60/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 3/5 1-2 天 新手友好度 55/100
查看 imgproxy/imgproxy 的全部 Issue
相似的 Issue
-
Correct local module testing instructions for Go sample contributors可能已有人在做 @slievrly 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 90/100
-
internal/core: cleanAttachmentName splits a rune at the 255-byte cap and stores invalid UTF-8可能已有人在做 @pacwestnobody 今天认领。 未关闭go good first issue help wanted
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
TestLaunchGolden spends about 98 seconds on fake-agent exit delays under -race可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
factory:subtask
难度 1/5 1 小时以内 新手友好度 95/100
维护者通常 1 天内回复
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 90/100
NotAFlightRisk/patchcall#11 ·
维护者通常 1 天内回复