Skip to content

Coverity: Uninitialized scalar variable#1041

Merged
padelsbach merged 1 commit into
wolfSSL:masterfrom
ejohnstown:cov-uninit-variable
Jun 16, 2026
Merged

Coverity: Uninitialized scalar variable#1041
padelsbach merged 1 commit into
wolfSSL:masterfrom
ejohnstown:cov-uninit-variable

Conversation

@ejohnstown

Copy link
Copy Markdown
Contributor
  1. Remove the check on authType, it is covered already.
  2. Add Keyboard Setup to the existing check on authType.
  3. Add a branch for User Auth None so it reaches its handler in the map loop rather than the new error case.
  4. Add else case for an error.

Fixes CID: 637345

@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 #1041

Scan targets checked: wolfssh-bugs, wolfssh-src

No new issues found in the changed files. ✅

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.

Pull request overview

This PR updates the examples/echoserver user-auth callback logic to address a Coverity report about an uninitialized scalar variable by tightening authType handling and ensuring special auth flows reach their intended handlers.

Changes:

  • Removes a redundant early authType validation block.
  • Explicitly handles WOLFSSH_USERAUTH_KEYBOARD_SETUP and WOLFSSH_USERAUTH_NONE so they flow into the map-loop handling instead of falling into an error path.
  • Adds a final else branch returning WOLFSSH_USERAUTH_INVALID_AUTHTYPE for unsupported auth types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/echoserver/echoserver.c
Comment thread examples/echoserver/echoserver.c
1. Remove the check on authType, it is covered already.
2. Add Keyboard Setup to the existing check on authType.
3. Add a branch for User Auth None so it reaches its handler
   in the map loop rather than the new error case.
4. Add else case for an error.

Fixes CID: 637345

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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@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 #1041

Scan targets checked: wolfssh-bugs, wolfssh-src

No new issues found in the changed files. ✅

@padelsbach padelsbach merged commit d43dfd5 into wolfSSL:master Jun 16, 2026
125 checks passed
@ejohnstown ejohnstown deleted the cov-uninit-variable branch June 16, 2026 17:45
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.

5 participants