dev_status: guard nullptr in Builds::name() #2313
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2313
Loading…
Reference in a new issue
No description provided.
Delete branch "ubiq-dev-status-null-name"
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 successfully merged and closed
Fixes a null-pointer dereference in
leonida::dev_status::Builds::name(const char* text)(runtime/src/dev_status.h):nullptrtoBuilds::name()(or constructingBuild(nullptr)) calledstd::strlen(nullptr), causing immediate UB/SIGSEGV.if (!text)by clearingname_[0] = 0and returning early.runtime/test/dev_status_test.cpp.Verification
g++ -std=c++20 -D_GLIBCXX_DEBUG -Wall -Wextra -Werror -pedantic -Iruntime/src runtime/test/dev_status_test.cpppassedg++ -std=c++20 -fsanitize=address,undefined -Wall -Wextra -Werror -pedantic -Iruntime/src runtime/test/dev_status_test.cpppassedubiq/mainpython3 -I scripts/check_no_game_data.py runtime/src/dev_status.h runtime/test/dev_status_test.cppcleanClaimed in the coordination issue as: RT-DEV-STATUS-NULL-NAME (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7193761192)
AI-assisted: yes (Gemini)
VERIFY-2313— verified head9ec18b2b87merged cleanly withmaind48a957bbon Windows 11 Pro (build 26200), MSVC19.44(x64,/std:c++20 /W4 /WX /permissive- /utf-8 /EHsc), synthetic build-status names only.Red (
maind48a957bb) -> Green (d48a957bb+9ec18b2b87)main:runtime/test/dev_status_test.cppagainstmain'sruntime/src/dev_status.h-> crashed with0xC0000005(STATUS_ACCESS_VIOLATION) callingstd::strlen(nullptr)insideBuilds::name(nullptr).cl.exe /nologo /std:c++20 /W4 /WX /permissive- /utf-8 /EHsc /I"runtime/src" runtime/test/dev_status_test.cpp-> 0 warnings, exit0(dev_status_test: ok).AI-assisted.
Verified by OreoFR
c1ecf04ed+ PR head9ec18b2b8; green run in a merge package of 16 PRs, no new ctest failure vs mainstandalone build of dev_status_test.exe (the test is not registered in CMake)AI-assisted (Claude Code, Claude Opus 5.5).
Tested
9ec18b2b8merged (no commit) withmainaa918e5d9, MSVC 19.52 (Visual Studio 18), Windows 11 10.0.26300.Blocker:
runtime/test/dev_status_test.cppis new but is not registered inruntime/CMakeLists.txt, so neither CI norctestever builds or runs it.ctest -Non the merge lists no such test, andtests/test_ctest_registration.pystill passes, so nothing catches this. Registering it the way the other header-only tests are would fix that:Hand-compiled (
cl /std:c++20 /EHsc /O2):dev_status_test: ok, exit 0.runtime/src/dev_status.hback tomain: crash, exit0xC0000005.I did not run the ctest tests relinked by the header change: test runs on this machine are paused for memory.
AI-assisted (Claude Code).
Merged. Tested by OreoFR (RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11) on this head: dev_status_test red on main (crash 0xC0000005), green with the PR. Note: the test is not registered in CMake, so ctest does not run it. AI-assisted: yes.