Skip to content
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

fix:UB with reading unitialized data in tests of "class PrivateKey" #358

Closed
wants to merge 1 commit into from

Conversation

knst
Copy link
Contributor

@knst knst commented Feb 23, 2023

This call memcmp is quite useless, because result is not used and more over it reads an un-itialized data.

@knst knst changed the title fix: fixed UB with reading unitialized data fix:UB with reading unitialized data in tests of "class PrivateKey" Feb 23, 2023
@github-actions
Copy link

'This PR has been flagged as stale due to no activity for over 60
days. It will not be automatically closed, but it has been given
a stale-pr label and should be manually reviewed.'

@@ -56,7 +56,6 @@ void TestHKDF(string ikm_hex, string salt_hex, string info_hex, string prk_expec

TEST_CASE("class PrivateKey") {
uint8_t buffer[PrivateKey::PRIVATE_KEY_SIZE];
memcmp(buffer, getRandomSeed().data(), PrivateKey::PRIVATE_KEY_SIZE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this was intended to say memcpy()

@knst
Copy link
Contributor Author

knst commented May 8, 2023

Done here: #370

@knst knst closed this May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants