Skip to content

Fix SHA-512 Finalize Re-Init Error Overwrite#311

Merged
bigbrett merged 1 commit intomainfrom
SHA512-Overwrite
Mar 18, 2026
Merged

Fix SHA-512 Finalize Re-Init Error Overwrite#311
bigbrett merged 1 commit intomainfrom
SHA512-Overwrite

Conversation

@jackctj117
Copy link
Contributor

This pull request makes a minor change to the wh_Client_Sha512 function in src/wh_client_crypto.c by discarding the return values of hash initialization functions, instead of assigning them to ret. This simplifies the code and indicates that the return values are intentionally unused.

Copilot AI review requested due to automatic review settings March 18, 2026 17:42
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 adjusts wh_Client_Sha512 to avoid overwriting an existing ret value when re-initializing SHA-512 variants after finalize, by explicitly discarding init return values.

Changes:

  • Replaced assignments to ret from wc_InitSha512*_ex calls with (void) casts to preserve any previously-set error code.
  • Standardized the “intentionally unused return value” pattern across SHA-512 variant init calls.

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

You can also share your feedback on Copilot code review. Take the survey.

@bigbrett bigbrett merged commit 18c46af into main Mar 18, 2026
55 checks passed
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