Repository navigation
fix: 主题包校验 gzip 校验和,被改过的包不再能装上 - #64
Merged
Merged
Conversation
stqfdyr
force-pushed
the
fix/theme-gzip-checksum
branch
from
September 24, 2026 19:14
7f92941 to
758fb25
Compare
tar 读到结束块就停,读不到 gzip 尾部的校验和:中途被改过字节、或者只丢了 结束块之后几个字节的包,每个条目都读得出来,照样装上。解压完把压缩流读到底, 校验和不对时给出与截断包相同的「主题包损坏或不完整」。 结束块之后只允许 1 MiB 的填充:不设上限时,塞在后面的零会以每 MiB 上传 1 GiB 解压的比例空耗 CPU。
stqfdyr
force-pushed
the
fix/theme-gzip-checksum
branch
from
September 24, 2026 19:18
758fb25 to
139d1da
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tar 读到结束块就停,读不到 gzip 尾部的校验和。中途被改过字节的包,或者只丢了结束块之后几个字节的包,每个条目都读得出来,照样能装上。
测试
cargo fmt --check、cargo clippy --all-targets、cargo test(126 个)通过