Skip to content

CFE-4687: Fixed off-by-one in protocol recv buffers (3.24)#6182

Merged
olehermanse merged 2 commits into
cfengine:3.24.xfrom
nickanderson:CFE-4687/3.24.x
Jun 29, 2026
Merged

CFE-4687: Fixed off-by-one in protocol recv buffers (3.24)#6182
olehermanse merged 2 commits into
cfengine:3.24.xfrom
nickanderson:CFE-4687/3.24.x

Conversation

@nickanderson

Copy link
Copy Markdown
Member

No description provided.

@cf-bottom

Copy link
Copy Markdown

Thank you for submitting a PR! Maybe @larsewi can review this?

@larsewi

larsewi commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@cf-bottom Jenkins please :)

@cfengine cfengine deleted a comment from cf-bottom Jun 19, 2026
@cf-bottom

Copy link
Copy Markdown

@larsewi

larsewi commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Build Status

@larsewi

larsewi commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

@cf-bottom Jenkins please :)

@cf-bottom

Copy link
Copy Markdown

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)
@olehermanse olehermanse merged commit f12e818 into cfengine:3.24.x Jun 29, 2026
3 checks passed
@cfengine cfengine deleted a comment from nickanderson Jun 29, 2026
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.

5 participants