From 3ee2151f1d4d7bf457f1701b3b3bbaf5944a93ab Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 28 Jul 2017 18:26:36 +0200 Subject: [PATCH] memzero(): with weak symbols, just call memset() --- src/libsodium/sodium/utils.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/libsodium/sodium/utils.c b/src/libsodium/sodium/utils.c index 662b54a7..bff6e359 100644 --- a/src/libsodium/sodium/utils.c +++ b/src/libsodium/sodium/utils.c @@ -87,12 +87,7 @@ sodium_memzero(void *const pnt, const size_t len) #elif defined(HAVE_EXPLICIT_BZERO) explicit_bzero(pnt, len); #elif HAVE_WEAK_SYMBOLS - unsigned char *pnt_ = (unsigned char *) pnt; - size_t i = (size_t) 0U; - - while (i < len) { - pnt_[i++] = 0U; - } + memset(pnt, 0, len); _sodium_dummy_symbol_to_prevent_memzero_lto(pnt, len); #else volatile unsigned char *volatile pnt_ =