xma: stop at a zero-length frame instead of looping forever #14

Manually merged
github merged 1 commit from gh-pr/14/head into gh-pr/14/base 2026-11-26 03:46:31 +00:00
Owner

@⁠9hvn9yt2vk-netizen on GitHub · 2026-11-23 23:02 UTC · original
9hvn9yt2vk-netizen:fix-xma-zero-length → main · +32 −1 · 1 files · 1 commits · merged 2026-11-23 23:18 UTC

next_frame walks the frames before start to learn whether the frame at start is the packet's last. A damaged packet whose earlier frame has a length of 0 never advanced at, so the walk spun forever (in a debug build it overflowed number after about 4 billion rounds and panicked).

Apply the rule read_frame already uses: a length that does not cover its own 15-bit field is not a frame, and the search ends.

Found with a random-input harness. The new test hangs without the fix and passes at once with it.

**@⁠9hvn9yt2vk-netizen** on GitHub · 2026-11-23 23:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/14) `9hvn9yt2vk-netizen:fix-xma-zero-length` → `main` · +32 −1 · 1 files · 1 commits · merged 2026-11-23 23:18 UTC next_frame walks the frames before `start` to learn whether the frame at `start` is the packet's last. A damaged packet whose earlier frame has a length of 0 never advanced `at`, so the walk spun forever (in a debug build it overflowed `number` after about 4 billion rounds and panicked). Apply the rule read_frame already uses: a length that does not cover its own 15-bit field is not a frame, and the search ends. Found with a random-input harness. The new test hangs without the fix and passes at once with it.
next_frame walks the frames before `start` to learn whether the frame at
`start` is the packet's last. A damaged packet whose earlier frame has a
length of 0 never advanced `at`, so the walk spun forever (in a debug build
it overflowed `number` after about 4 billion rounds and panicked).

Apply the rule read_frame already uses: a length that does not cover its
own 15-bit field is not a frame, and the search ends.

Found with a random-input harness. The new test hangs without the fix and
passes at once with it.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:46:29 +00:00
github manually merged commit 005ad49872 into gh-pr/14/base 2026-11-26 03:46:31 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!14
No description provided.