fix make scrambled password segmentation fault bug when password longer than 26 characters #91
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.
Comment
Hello,
I found a segmentation fault bug when use long long password(longer than 26 characters. like 32) in make_scrambled_password function.
During create password by sha1, temporary variable h0 will set zero for clear.
But, for now, set zero to h0 until length of password .
h0 variable is just 20 bytes, but password can set 255 characters.
So if password is too long, I thing it will cleanup data even outside of the h0 variable range.
In this PR, make set zero h0 just for size of h0 for not occur segmentation fault.