Skip to content

Conversation

@embhorn
Copy link
Member

@embhorn embhorn commented Nov 25, 2025

Description

Fix cases where code uses WOLFSSL_GENERAL_ALIGNMENT as a compiler conditional

Fixes zd20515

Testing

customer confirmed

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@embhorn embhorn self-assigned this Nov 25, 2025
@embhorn embhorn requested a review from Copilot November 25, 2025 20:32
Copilot finished reviewing on behalf of embhorn November 25, 2025 20:33
Copy link
Contributor

Copilot AI left a comment

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 fixes Coverity dead code reports by removing redundant runtime checks for the align variable inside preprocessor blocks where WOLFSSL_GENERAL_ALIGNMENT > 0. Since WOLFSSL_GENERAL_ALIGNMENT is defined as either 0, 4, or 16 in settings.h, when the preprocessor condition evaluates to true, the align variable is guaranteed to be non-zero, making the runtime if (align) checks dead code.

  • Removes redundant if (align) checks inside #if WOLFSSL_GENERAL_ALIGNMENT > 0 blocks
  • Adds proper #else branches to handle the case when WOLFSSL_GENERAL_ALIGNMENT is 0
  • Applies fixes to two similar functions: GrowAnOutputBuffer() and GrowOutputBuffer()

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

@embhorn embhorn assigned wolfSSL-Bot and unassigned embhorn Nov 25, 2025
@SparkiDev SparkiDev self-assigned this Nov 25, 2025
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.

3 participants