tombox-archive: block colliding entry names #244
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!244
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/244/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@gringoestrangeiro on GitHub · 2026-11-23 07:09 UTC · original
gringoestrangeiro:archive-block-colliding-names→main· +59 −0 · 2 files · 1 commits · closed without mergingLibrary / area:
tombox-archive(ZIP inventory + extraction-safety validator). No console exports change.Problem:
validate()looked at each central-directory name in isolation, so an archive could carry two entries that resolve to the same path on Windows and still be reported safe to extract. Examples:Game/Content/a.pakplusgame/content/A.PAK, or a fileGame/Contentplus a directorygame/content/. Extraction keeps whichever entry lands last, so the file on disk is not the inventory that was vetted.Change: track normalized names during validation and turn a collision into a blocking finding. Names are compared after separator normalization, trailing-slash removal and lowercasing, which catches case-only duplicates and file/directory collisions. Repeated directory entries stay allowed because they do not overwrite file data.
Tests:
cargo test --locked -p tombox-archivepasses (18 tests), including the new cases for a case-only duplicate, a file/directory collision, and distinct names plus repeated directories remaining safe. The PR gate reports 0 problems on the diff.cargo test -p tombox-archivepasses@omonkeyz on GitHub · 2026-11-23 13:45 UTC · original
Applied locally on main with your authorship kept (cherry-picked,
bb15e8e); tests pass in a sandbox. It ships in the next release; this PR will be closed when that is pushed. Thanks.@kiwe147 on GitHub · 2026-11-23 19:15 UTC · original
Tested head
7516c2d24e, applied withgit apply(whitespace ignored, the line endings of my checkout differ) onmainf89e410, together with #242, #248 (one tree; the PRs touch different files). It applied without conflicts and built.Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, NVIDIA GeForce RTX 3080 (driver 621.24), MSVC, Rust 1.91.1.
cargo test -p tombox-archiveNo new failure against
mainf89e410in any of these. This is one combined tree, not a run of this PR alone.AI-assisted: yes (Claude Code)
@omonkeyz on GitHub · 2026-11-25 13:09 UTC · original
Applied on main in
bb15e8e(cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.Pull request closed