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

unit_tests: don't take the address of an unwrapped secret key #4848

Merged
merged 1 commit into from Dec 4, 2018

Conversation

3 participants
@moneromooo-monero
Contributor

moneromooo-monero commented Nov 14, 2018

No description provided.

@@ -55,7 +58,7 @@ namespace
static_assert(alignof(T) == 1, "T must have 1 byte alignment");
static_assert(sizeof(T) <= sizeof(source), "T is too large for source");
static_assert(sizeof(T) * 2 <= sizeof(expected), "T is too large for destination");
std::memcpy(std::addressof(value), source, sizeof(T));
std::memcpy(addressof(value), source, sizeof(T));

This comment has been minimized.

@vtnerd

vtnerd Nov 16, 2018

Contributor

std::addressof(unwrap(unwrap(value)) ? Either way I thought crypto::secret_key was double wrapped.

This comment has been minimized.

@moneromooo-monero

moneromooo-monero Nov 16, 2018

Contributor

Yes, but the compiler seems to be able to do the second one by itself. Not sure why though.I'll make it unwrap twice, seems better indeed.

@moneromooo-monero moneromooo-monero force-pushed the moneromooo-monero:osuw branch from 76dd7c3 to 80be2dc Nov 16, 2018

@fluffypony

Reviewed

@fluffypony fluffypony merged commit 80be2dc into monero-project:master Dec 4, 2018

7 of 10 checks passed

buildbot/monero-static-osx-10.11 Build done.
Details
buildbot/monero-static-osx-10.12 Build done.
Details
buildbot/monero-static-ubuntu-i686 Build done.
Details
buildbot/monero-linux-armv7 Build done.
Details
buildbot/monero-linux-armv8 Build done.
Details
buildbot/monero-static-osx-10.13 Build done.
Details
buildbot/monero-static-ubuntu-amd64 Build done.
Details
buildbot/monero-static-win32 Build done.
Details
buildbot/monero-static-win64 Build done.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

fluffypony added a commit that referenced this pull request Dec 4, 2018

Merge pull request #4848
80be2dc unit_tests: don't take the address of an unwrapped secret key (moneromooo-monero)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment