Skip to content

CFE-4687: Fixed off-by-one in protocol recv buffers (3.27)#6181

Open
nickanderson wants to merge 2 commits into
cfengine:3.27.xfrom
nickanderson:CFE-4687/3.27.x
Open

CFE-4687: Fixed off-by-one in protocol recv buffers (3.27)#6181
nickanderson wants to merge 2 commits into
cfengine:3.27.xfrom
nickanderson:CFE-4687/3.27.x

Conversation

@nickanderson

Copy link
Copy Markdown
Member

No description provided.

nickanderson and others added 2 commits June 16, 2026 15:12
ProtocolOpenDir()/ProtocolGet() receive up to CF_MSGSIZE bytes into a
char buf[CF_MSGSIZE], but the receive primitives NUL-terminate at
buf[received] where received can equal CF_MSGSIZE -- one past the array
(TLSRecv/RecvSocketStream both write toget+1 bytes).

Drives the real ProtocolOpenDir() over a classic-protocol socketpair with
a record-filling reply. Aborts under AddressSanitizer on current code,
passes once the buffers are sized CF_BUFSIZE (cfengine#6171).

Ref: CFE-4687, cfengine#6171

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit a79b5ce)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants