Skip to content

Fix metadata label leak in WH_KEY_EXPORT error response#316

Merged
bigbrett merged 2 commits intomainfrom
Key-export-leak
Mar 23, 2026
Merged

Fix metadata label leak in WH_KEY_EXPORT error response#316
bigbrett merged 2 commits intomainfrom
Key-export-leak

Conversation

@jackctj117
Copy link
Contributor

This pull request contains a minor code change that adjusts the placement of the memcpy operation in the wh_Server_HandleKeyRequest function. The memcpy call, which copies the key label, is now executed regardless of whether an error occurred, rather than only when there is no error. This ensures the label is always set in the response.

  • The memcpy statement copying the key label to resp.label in wh_Server_HandleKeyRequest is now executed outside the error check, ensuring the label is set in the response regardless of error status. (src/wh_server_keystore.c)

Copilot AI review requested due to automatic review settings March 19, 2026 21:21
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 targets the WH_KEY_EXPORT server handler to address label handling in export responses, specifically around error-path behavior.

Changes:

  • Moves the memcpy that populates resp.label in WH_KEY_EXPORT handling.
  • Updates when the label is included in the export response relative to ret == WH_ERROR_OK.

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

@bigbrett bigbrett merged commit 80f0133 into main Mar 23, 2026
51 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