fix: S12.23 PassthroughBuffer error path completeness#445
Conversation
Currently SolidSyslogPassthroughBuffer_Create stores the sender pointer unchecked, so the first subsequent Write dispatches SolidSyslogSender_Send(NULL, ...) and crashes. Guard at _Create entry, emit PASSTHROUGHBUFFER_ERROR_NULL_SENDER, and return the shared SolidSyslogNullBuffer fallback. Pin three contract properties: ERROR reporting, fallback distinct from any pool slot, and no slot consumption. S12.23 #444
Destroy(NULL) is already safe by fallthrough (IndexFromHandle returns POOL_SIZE, IndexIsValid returns false, UNKNOWN_DESTROY warning fires). Pin that contract with a characterization test, and drop the IGNORE_TEST(HappyPathOnly) placeholder now that every referent is either pinned or out of scope per the story spec (Write(NULL buffer) remains on E12's NULL-guards-on-public-entry-points list). This was the last IGNORE_TEST in the codebase. S12.23 #444
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR adds NULL sender validation to the passthrough buffer creation function. When ChangesNULL Sender Validation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
☀️ Quality Summary 🚦 build-linux-gcc: 100% successful (✔️ 1330 passed) Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result. |
Summary
SolidSyslogPassthroughBuffer_Createagainst aNULLsender at entry, returning the sharedSolidSyslogNullBufferfallback and emitting a newPASSTHROUGHBUFFER_ERROR_NULL_SENDERcode instead of crashing on the first subsequentWrite.Destroy(NULL)fallthrough.IGNORE_TEST(SolidSyslogPassthroughBuffer, HappyPathOnly)placeholder — every referent is now pinned or out of scope per the story spec. This was the lastIGNORE_TESTin the codebase.Closes #444. Sibling of S12.07 / #443.
Test plan
cmake --build --preset debug && ctest --preset debug— greencmake --build --preset clang-debug && ctest --preset clang-debug— greencmake --build --preset sanitize && ctest --preset sanitize— greencmake --build --preset tidy— greencmake --build --preset coverage --target coverage—Core/Source/SolidSyslogPassthroughBuffer*.cat 100%cmake --build --preset iwyu --target iwyu— greenclang-format --dry-run --Werrorover changed files — greenanalyze-cppcheck(both plain and--addon=misra) — runs in container with cppcheck available🤖 Generated with Claude Code
Summary by CodeRabbit