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

Merged
9hvn9yt2vk-netizen merged 1 commit from upstream-pr/14 into main 2026-11-23 23:18:10 +00:00
9hvn9yt2vk-netizen commented 2026-11-23 23:02:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 9hvn9yt2vk-netizen on 2026-11-23T23:02:01Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6570622993 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/14). Originally posted by [9hvn9yt2vk-netizen](https://github.com/9hvn9yt2vk-netizen) on 2026-11-23T23:02:01Z. --- 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.
upstream-sync closed this pull request 2026-11-24 06:50:55 +00:00
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
Marvisak/VIctory!14
No description provided.