mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:50:53 +01:00
[PR #484] [MERGED] XDXR-STREAM-RECORD-BOUNDS: require complete 16-byte StreamRecords in find_stream_record #534
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#534
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/484
Author: @xroneyaa
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism
Base:
main← Head:fix/xdxr-stream-record-bounds📝 Commits (1)
36e9f9fxdxr_descs: require complete 16-byte StreamRecords in find_stream_record📊 Changes
2 files changed (+16 additions, -4 deletions)
View changed files
📝
runtime/src/xdxr_descs.h(+3 -4)📝
runtime/test/xdxr_descs_test.cpp(+13 -0)📄 Description
Claimed in the coordination issue as: XDXR-STREAM-RECORD-BOUNDS
What and why
leonida::xdxr::find_stream_record()inruntime/src/xdxr_descs.hcomputedend = reinterpret_cast<const StreamRecord*>(static_cast<const uint8_t*>(desc.stream) + desc.size_in_bytes)and loopedfor (; record < end; ++record). Wheneversize_in_byteswas not a multiple ofsizeof(StreamRecord)(16 bytes), the last iteration read a full 16-byte record past the caller's buffer end, and a very largesize_in_bytescould wrap pointer addition.This checks
desc.size_in_bytes < sizeof(StreamRecord) || desc.stream == nullptrand iterates strictly overcount = desc.size_in_bytes / sizeof(StreamRecord)complete records. Added boundary unit tests inruntime/test/xdxr_descs_test.cppfor sizes1,4,15,17, and31bytes.Tested
xdxr_descs_testwith MSVC 19.50 / Ninja (0 warnings)ctest --test-dir runtime/build -R "^xdxr_descs$" --output-on-failure-> 1/1 Passed (0.01 s)python -I scripts/check_no_game_data.py runtime/src/xdxr_descs.h runtime/test/xdxr_descs_test.cpp-> exit 0GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed (n/a — no translator rule added).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.