echoserver: check the id before the legacy claim - #1274
Merged
Merged
Conversation
The legacy claim in ssh_worker() now takes the channel id as part of its condition and marks the session connected only once the id is stored, the same order wsShellStartCb() uses. Issue: CID-656285
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved review issues remain.
Review effort: Lite
Findings: None
What changed in this PR
This PR fixes the echoserver legacy channel claim by validating channel ID retrieval before marking the session connected.
Changes:
- Requires
WS_SUCCESSfromwolfSSH_ChannelGetId(). - Prevents invalid sessions from entering the connected state.
| File | Description |
|---|---|
examples/echoserver/echoserver.c |
Validates channel ID retrieval during legacy session setup. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1274
Scan targets checked: wolfssh-src, wolfssh-bugs
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
philljj
approved these changes
Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses Coverity CID 656285:
ssh_worker()'s legacy claim ignored the return value ofwolfSSH_ChannelGetId(). The claim now requiresWS_SUCCESSbefore marking the session connected.make checkon clang and gcc-16 (--enable-all), and with an OpenSSH non-sftp subsystem request, which reaches the changed path.