Repository navigation
S24.09: StreamSender bad-setup contract — reject NULL Resolver / Stream / Address #424
Description
Parent epic: #254
Motivation
SolidSyslogUdpSender_Create validates its config and rejects NULL
Resolver / Datagram / Address / Endpoint with the bad-setup
contract from S12.06 — SolidSyslog_Error(ERR, ...) + nil-object
fallback (SolidSyslogNullSender).
SolidSyslogStreamSender_Create has no equivalent. It happily accepts
a config with NULL Resolver, NULL Stream, or NULL Address, then crashes
on the first SolidSyslogSender_Send when it dereferences the missing
collaborator. CodeRabbit flagged the new config->Address NULL path
on PR #422; deferred from S24.07 because adding only Address
validation without the other three would be inconsistent — fixing the
whole bad-setup contract together is its own atom.
This story brings StreamSender to the same bad-setup posture as
UdpSender.
Current state (audit 2026-05-25, main @ 4b3a361)
Core/Source/SolidSyslogStreamSenderStatic.c::SolidSyslogStreamSender_Create
has noIsValidConfighelper and no NULL-checks onconfig,Resolver,
Stream, orAddress. The only failure path it emits is
STREAMSENDER_ERROR_POOL_EXHAUSTED.Core/Interface/SolidSyslogStreamSenderErrors.henum lists only
POOL_EXHAUSTED,UNKNOWN_DESTROY,MAX.Core/Source/SolidSyslogStreamSenderMessages.ccarries only those two
message strings.Tests/SolidSyslogStreamSenderTest.cpphas noSolidSyslogStreamSenderBadSetup
TEST_GROUP — grep forBadSetup/NULL_RESOLVERreturns nothing.
No prior work landed on this story; all four acceptance criteria are
outstanding.
Acceptance criteria
-
SolidSyslogStreamSender_Createrejectsconfig == NULL,
config->Resolver == NULL,config->Stream == NULL, and
config->Address == NULLwith distinct
STREAMSENDER_ERROR_NULL_{CONFIG,RESOLVER,STREAM,ADDRESS}codes
(naming matches theUDPSENDER_ERROR_NULL_*convention). - On bad config,
_CreatereturnsSolidSyslogNullSender_Get()—
pool slot is not consumed. MatchesSolidSyslogUdpSender_Create's
IsValidConfig/early-return shape
(Core/Source/SolidSyslogUdpSenderStatic.c:48-76). - Existing tests pass; new TDD-driven tests cover each of the four
NULL paths (mirroring theSolidSyslogUdpSenderBadSetuptests at
Tests/SolidSyslogUdpSenderTest.cpp:763-823). - CLAUDE.md
SolidSyslogStreamSender.hrow updated to note the
bad-setup contract (currently says "Pool exhaustion resolves to
the sharedSolidSyslogNullSender"; extend with the bad-config
fallback as theSolidSyslogUdpSender.hrow already does). - No behaviour change for existing valid wirings — only adds the
NULL-rejection paths.
References
- S12.06 — established the bad-setup contract.
- S24.07 — added
config->Addressto StreamSenderConfig; deferred the
matching bad-setup validation. - PR feat!: S24.07 SolidSyslogAddress as pool-allocated handle #422 — CodeRabbit raised the missing validation.
Activity