Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 311f27a506
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } else { | ||
| for ((component, child) in entries) visit(child, path + component) |
There was a problem hiding this comment.
Reject empty directory nodes in file trees
When a tree contains an empty dictionary below a path alongside at least one valid file, this branch iterates zero children and silently discards that subtree, so parse() returns supposedly validated metadata for a malformed BEP 52 file tree. Require non-file nodes to contain at least one child before traversing them.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 6818eff. Non-file nodes now require at least one child. Regression coverage rejects direct and nested empty directories beside a valid file while still accepting zero-length files. The focused v2 info and piece-layer tests pass.
|
Superseded by #232 (V2 identity, metainfo and Merkle integrity) in the consolidated eight-PR stack for #162. The replacement preserves this PR's code and subsequent fixes; its description links the original head and review discussions. The only additional consolidation fix is the CI-discovered listener cancellation regression, documented on the replacement. All eight replacements have passed their required CI checks. Closing without merging. This branch and its discussions remain available for reference. Review index: #162 (comment) |
Add bounded parsing of the v2 fields in a raw info dictionary and authentication of its imported external piece layers. Raw paths and info bytes remain byte-exact; version, piece geometry, file-tree structure, lengths, root sizes, and caller-supplied exact topics are validated before returning metadata.
Part of #162, stacked on #171 (
torrent-v2-04-identity). The piece-layer verifier streams individual hashes through a shared Merkle frontier, applies zero padding at the piece-size layer, and checks each root/topology once when several files share a layer. The dictionary adapter rejects missing/unreferenced roots, incorrect hash counts, corrupt hashes, and excess layer bytes.The raw-info parser does not validate the enclosing metainfo document or a hybrid's v1 layout. Filesystem mapping, streaming/spilled metainfo loading, wire acquisition, and v2 download integration remain separate roadmap work. These internal primitives do not advertise completed v2 support.
Validation: focused parser, layer, and Merkle tests pass, including independent JDK full-tree comparisons across piece sizes and incomplete subtrees. All 333 local torrent tests passed with no skipped tests, both pinned-client conformance scenarios executed, and the native-runtime dependency guard passed.