Replay: refuse a capture whose submissions name lists it does not hold (indexed out of bounds) #275

Open
sharan104 wants to merge 1 commit from upstream-pr/275 into main
sharan104 commented 2026-11-26 14:04:20 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by sharan104 on 2026-11-26T14:04:20Z.


Frame::read (replay/wire.rs) took a submission's list numbers as they came. The callers then index frame.lists directly:

  • listing (play.rs)
  • look::flow
  • the replay itself, including diverge.rs

So a corrupt or truncated frame.bin naming a list past the end made victory replay panic with an index out of bounds, instead of refusing the file the way Frame::read already does for other bad data.

Fix: Frame::read refuses any list number that is neither MISSING nor inside lists, with Bad("a submission of a list it does not hold"). The recorder only ever writes those two kinds, so captures it made still load.

Test: a_submission_of_a_list_not_there_is_refused writes a frame whose submission names [0, MISSING], which still reads, and one naming [0, 1] with a single list, which is refused. It fails with the check removed, and passed 10 runs out of 10 with it.

Results:

  • Tests with --features diagnostics pass.
  • Clippy -D warnings adds nothing beyond main's existing watch.rs lint, which #241 fixes.

🤖 Generated with Claude Code

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6628336893 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/275). Originally posted by [sharan104](https://github.com/sharan104) on 2026-11-26T14:04:20Z. --- `Frame::read` (`replay/wire.rs`) took a submission's list numbers as they came. The callers then index `frame.lists` directly: - `listing` (`play.rs`) - `look::flow` - the replay itself, including `diverge.rs` So a corrupt or truncated `frame.bin` naming a list past the end made `victory replay` panic with an index out of bounds, instead of refusing the file the way `Frame::read` already does for other bad data. **Fix:** `Frame::read` refuses any list number that is neither `MISSING` nor inside `lists`, with `Bad("a submission of a list it does not hold")`. The recorder only ever writes those two kinds, so captures it made still load. **Test:** `a_submission_of_a_list_not_there_is_refused` writes a frame whose submission names `[0, MISSING]`, which still reads, and one naming `[0, 1]` with a single list, which is refused. It fails with the check removed, and passed 10 runs out of 10 with it. **Results:** - Tests with `--features diagnostics` pass. - Clippy `-D warnings` adds nothing beyond main's existing `watch.rs` lint, which #241 fixes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/275:upstream-pr/275'
git switch 'upstream-pr/275'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/275'
git switch 'upstream-pr/275'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/275'
git switch 'upstream-pr/275'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/275'
git switch 'main'
git merge --squash 'upstream-pr/275'
git switch 'main'
git merge --ff-only 'upstream-pr/275'
git switch 'main'
git merge 'upstream-pr/275'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
avatarmanz/VIctory-7900XTX!275
No description provided.