Repository navigation
Conversation
TimWolla
requested changes
Nov 16, 2026
TimWolla
left a comment
Member
There was a problem hiding this comment.
I don't think this is the correct fix: Leaving the original string unmodified for sodium_memzero() violates user expectations. For a typed property the string should probably be replaced by an all-NUL string of the same length or something like that.
Contributor
Author
|
Changed in 2c74e39: if the property type doesn't allow null, it now keeps a NUL-filled string of the same length, and nullable properties still get null. sodium_crypto_generichash_final() works the same way. |
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.
sodium_memzero()cleared its argument withconvert_to_null()on the dereferenced value, so the type of a typed property holding the reference was never checked and astringproperty ended up as null. Now, when a property type does not allow null, the property keeps a string of NUL bytes with the same length instead. Nullable and untyped targets still become null.sodium_crypto_generichash_final()had the same problem with its$stateargument and gets the same fix.Fixes #25487