Fix metadata label leak in WH_KEY_EXPORT error response#316
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
memcpythat populatesresp.labelinWH_KEY_EXPORThandling. - 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
approved these changes
Mar 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.
This pull request contains a minor code change that adjusts the placement of the
memcpyoperation in thewh_Server_HandleKeyRequestfunction. Thememcpycall, 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.memcpystatement copying the key label toresp.labelinwh_Server_HandleKeyRequestis now executed outside the error check, ensuring the label is set in the response regardless of error status. (src/wh_server_keystore.c)