Have sodium_munlock() zero the buffer before unlocking it.

This commit is contained in:
Frank Denis 2014-05-06 09:18:31 -07:00
parent 2094263048
commit a30f364ce1

View File

@ -172,6 +172,7 @@ sodium_mlock(void * const addr, const size_t len)
int int
sodium_munlock(void * const addr, const size_t len) sodium_munlock(void * const addr, const size_t len)
{ {
sodium_memzero(addr, len);
#ifdef HAVE_MLOCK #ifdef HAVE_MLOCK
return munlock(addr, len); return munlock(addr, len);
#elif defined(HAVE_VIRTUALLOCK) #elif defined(HAVE_VIRTUALLOCK)