Skip to content

agent: check GetUint32 when reading message sizes - #1311

Open
ejohnstown wants to merge 1 commit into
wolfSSL:masterfrom
ejohnstown:agent-getuint32-checked
Open

ejohnstown wants to merge 1 commit into
wolfSSL:masterfrom
ejohnstown:agent-getuint32-checked

Conversation

@ejohnstown

@ejohnstown ejohnstown commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Check the return from GetUint32() at the two agent call sites that ignored it, matching the other callers. Neither could fail, since both already confirm four bytes are available.

  • AgentReadMessage(): check before the message size range test
  • wolfSSH_AGENT_RelayChannel(): leave the relay loop on a failed read

Issue: CID-656509

AgentReadMessage() and wolfSSH_AGENT_RelayChannel() now check the
return from GetUint32() when reading an agent message's length
prefix, like the other callers do.

Issue: CID-656509
Copilot AI balanced review requested due to automatic review settings October 12, 2026 15:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused changes correctly propagate parser errors without altering successful behavior.

0 open findings

What changed in this PR

Checks GetUint32() results when parsing agent message lengths, addressing CID-656509.

Changes:

  • Propagates parsing failures in AgentReadMessage().
  • Exits relay processing if message-length parsing fails.
File Description
src/​agent.c Handles previously ignored GetUint32() results.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #1311

Scan targets checked: wolfssh-src, wolfssh-bugs
Coverage: 1 of 1 in-scope changed file(s) opened by the reviewer

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Lite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants