-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential UB in cpuperf: passing NULL to memcpy() #336
Comments
Thanks for the report! I think that we're fine, though. If
on line 390 of that file (whereas the quoted section is line 400). [1] I haven't traced through every step between |
I did some further digging, in the R package with the old lib, the UB was triggered but I didn't manage to get it NULL in the latest version here. With this code I do see You have far more expertise though, so I'll let you close if it's indeed nothing. |
The check for @bobjansen I highly recommend updating your package to use a newer version of scrypt though, 1.1.6 is 12 years old... |
Thanks for the clarification and that's a fair point, the package was very much in maintenance mode but it might be good to consider. |
This issue was found by automated checks on the R-package scrypt which I maintain. That package is based on scrypt 1.1.6 but I believe the issue could still be present in the current version of scrypt. The offending block in
_SHA256_Update()
is:The function
scryptenc_cpuperf()
has the following call:where the third argument represents the salt.
crypto_scrypt()
passes the salt toPBKDF2_SHA256()
which passes to_HMAC_SHA256_Update()
, to_SHA256_Update()
which then goes by the namesrc
.The text was updated successfully, but these errors were encountered: