use corrected version of zeromem() from @dtrebbien

This commit is contained in:
Steffen Jaeckel 2012-11-23 00:53:54 +01:00
parent f32e52d5ac
commit 7050bdb7c8
2 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@ int base64_decode(const unsigned char *in, unsigned long len,
#endif #endif
/* ---- MEM routines ---- */ /* ---- MEM routines ---- */
void zeromem(void *dst, size_t len); void zeromem(volatile void *dst, size_t len);
void burn_stack(unsigned long len); void burn_stack(unsigned long len);
const char *error_to_string(int err); const char *error_to_string(int err);

View File

@ -20,12 +20,12 @@
@param out The destination of the area to zero @param out The destination of the area to zero
@param outlen The length of the area to zero (octets) @param outlen The length of the area to zero (octets)
*/ */
void zeromem(void *out, size_t outlen) void zeromem(volatile void *out, size_t outlen)
{ {
unsigned char *mem = out; volatile char *mem = out;
LTC_ARGCHKVD(out != NULL); LTC_ARGCHKVD(out != NULL);
while (outlen-- > 0) { while (outlen-- > 0) {
*mem++ = 0; *mem++ = '\0';
} }
} }