mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:45:53 +01:00
[PR #2016] runtime: guard null and invalid sizes in value_write_sink and add unit tests (RT-VALUE-WRITE-SINK-GUARDS-AND-TESTS) #2021
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#2021
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/2016
Author: @abnalstlll-byte
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:feat/rt-value-write-sink-guards-and-tests📝 Commits (1)
804f974runtime: guard null and invalid sizes in value_write_sink and add unit tests (RT-VALUE-WRITE-SINK-GUARDS-AND-TESTS)📊 Changes
3 files changed (+238 additions, -1 deletions)
View changed files
📝
runtime/CMakeLists.txt(+7 -0)📝
runtime/src/value_write_sink.h(+12 -1)➕
runtime/test/value_write_sink_test.cpp(+219 -0)📄 Description
Claimed in the coordination issue as: RT-VALUE-WRITE-SINK-GUARDS-AND-TESTS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7170514927)
What and why
Harden
runtime/src/value_write_sink.hand provide unit test coverage:arena()against null buffer pointers and non-4/8-byte sizes by immediately returningLanding::refused, preventing null dereference and invalid writes.title_pages()against null addresses, null bytes, and zero size by returningfalseimmediately.clear_arena()against null device pointers (!device).clear_title_pages()andreset_for_test()to allow clean state resets across tests and teardown.runtime/test/value_write_sink_test.cppverifying initial state, guards, arena and title_pages dispatch, device-matched clearing, and multi-threaded concurrency.Tested
g++ -std=c++20 -Wall -Wextra runtime/test/value_write_sink_test.cpp-> builds cleanly, runs and exits 0 (OK: value_write_sink_test passed all checks).python -I tests/test_ci_registration.py->Ran 16 tests in 4.676s,OK.python -I tests/test_text_write_line_endings.py->Ran 3 tests in 11.795s,OK.python -I scripts/check_no_game_data.py runtime/src/value_write_sink.h runtime/test/value_write_sink_test.cpp runtime/CMakeLists.txt->exit 0.git diff --check->clean.Tested on Windows 11 x64 (GCC C++20 / Python 3.12, stdlib tests, no game data needed).
AI-assisted (Claude Code)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.