Skip to content

fix: zeroize full string capacity when building shroudedstring from string#14

Open
mooncitydev wants to merge 1 commit intothesis:mainfrom
mooncitydev:fix/zeroize-string-spare-capacity
Open

fix: zeroize full string capacity when building shroudedstring from string#14
mooncitydev wants to merge 1 commit intothesis:mainfrom
mooncitydev:fix/zeroize-string-spare-capacity

Conversation

@mooncitydev
Copy link
Copy Markdown

Issue

write_and_zeroize_source only cleared len bytes of the source buffer; any spare capacity in the heap-backed String could still retain secret material after the copy.

Fix

Call Zeroize::zeroize on the String after the copy completes so the entire allocation (including slack capacity) is cleared, consistent with the zeroize crate behavior for String.

made by mooncitydev

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.

1 participant