pipeline_cache_journal: guard null bytes/kind and avoid entry_path truncation #2307
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2307"
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?
Imported from ubiquitarianism/leonida. Originally posted by narekshaghoyandev on 2026-11-26T13:35:00Z.
Fixes null-pointer dereferences and fixed-buffer truncation in
runtime/src/pipeline_cache_journal.h:Hasher::bytes(const void* data, std::size_t size)againstdata == nullptr(orsize == 0) before dereferencing.entry_path()dynamically (std::string+suffix) instead ofsnprintfinto a fixed 64-byte buffer, and default null/emptykindto"entry"so longkindnames never truncate the hex key/.binsuffix and nullkindnever triggers UB.runtime/test/pipeline_cache_journal_test.cppcovering nullHasher::bytes, nullkind, and 60-charkindinentry_path().Verification
g++ -std=c++20 -D_GLIBCXX_DEBUG -Wall -Wextra -Werror -pedanticpassedg++ -std=c++20 -fsanitize=address,undefined -Wall -Wextra -Werror -pedanticpassedubiq/mainpython3 -I scripts/check_no_game_data.py runtime/src/pipeline_cache_journal.h runtime/test/pipeline_cache_journal_test.cppcleanClaimed in the coordination issue as: RT-PIPELINE-JOURNAL-NULL-AND-KIND (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7193017383)
AI-assisted: yes (Gemini)
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-26T17:57:36Z.
Review: COMMENTED
Windows 11/MSVC:
pipeline_cache_journalCTest passed, including the synthetic null-input and long filename cases. No findings from these checks.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T12:38:49Z.
Verified on Windows 11 (
10.0.26200.9974) with MSVC19.44.35228(x64,/std:c++20 /EHsc /W4 /permissive- /utf-8 /O2) againstmaind48a957bb+0791348ed4(claim#2570#issuecomment-7239309422):runtime/src/pipeline_cache_journal.h,runtime/test/pipeline_cache_journal_test.cpp); guardsHasher::bytesagainstnullptr/ zero length and constructsentry_pathfilenames with"entry"fallback for null/emptykindplus dynamicstd::stringconcatenation so longkindprefixes are never truncated at 64 bytes.check_no_game_data.pyclean.d48a957bb+ PR test):pipeline_cache_journal_test.execrashes with0xc0000005(STATUS_ACCESS_VIOLATION) onnull_h.bytes(nullptr, 16).d48a957bb+0791348ed4merge): Auto-merges cleanly (rc=0), introduces0new compiler warnings, and passes (pipeline_cache_journal_test: ok,rc=0).AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T18:11:00Z.
Red/green: On main pipeline_cache_journal_test crashes with a segmentation fault (null bytes passed to the journal), and with the PR ctest -R "^pipeline_cache_journal$" passes.
Independent tester (OreoFR, RTX 4070, Windows 11): PR head merged with the other PRs of its batch on main
c1ecf04ed, full ctest run (485 tests, tests that launch the game excluded): no new failure compared with main.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T22:01:40Z.
Verified by OreoFR
c1ecf04ed+ PR head0791348ed; green run in a merge package of 16 PRs, no new ctest failure vs mainctest -R "^pipeline_cache_journal$"AI-assisted (Claude Code, Claude Opus 5.5).