memzero(): with weak symbols, just call memset()
This commit is contained in:
parent
105f7108d6
commit
3ee2151f1d
@ -87,12 +87,7 @@ sodium_memzero(void *const pnt, const size_t len)
|
|||||||
#elif defined(HAVE_EXPLICIT_BZERO)
|
#elif defined(HAVE_EXPLICIT_BZERO)
|
||||||
explicit_bzero(pnt, len);
|
explicit_bzero(pnt, len);
|
||||||
#elif HAVE_WEAK_SYMBOLS
|
#elif HAVE_WEAK_SYMBOLS
|
||||||
unsigned char *pnt_ = (unsigned char *) pnt;
|
memset(pnt, 0, len);
|
||||||
size_t i = (size_t) 0U;
|
|
||||||
|
|
||||||
while (i < len) {
|
|
||||||
pnt_[i++] = 0U;
|
|
||||||
}
|
|
||||||
_sodium_dummy_symbol_to_prevent_memzero_lto(pnt, len);
|
_sodium_dummy_symbol_to_prevent_memzero_lto(pnt, len);
|
||||||
#else
|
#else
|
||||||
volatile unsigned char *volatile pnt_ =
|
volatile unsigned char *volatile pnt_ =
|
||||||
|
Loading…
Reference in New Issue
Block a user