From b17254925ddd82aa633ca8128751b93840fabc9b Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Thu, 25 May 2017 22:19:46 +0800 Subject: [PATCH] Just use memset, it should'be be optimised out in a separate file --HG-- branch : fuzz --- dbhelpers.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/dbhelpers.c b/dbhelpers.c index f7461d9..bb9c2fc 100644 --- a/dbhelpers.c +++ b/dbhelpers.c @@ -9,16 +9,8 @@ void m_burn(void *data, unsigned int len) { #elif defined(HAVE_EXPLICIT_BZERO) explicit_bzero(data, len); #else -/* Based on the method in David Wheeler's - * "Secure Programming for Linux and Unix HOWTO". May not be safe - * against link-time optimisation. */ - volatile char *p = data; - - if (data == NULL) - return; - while (len--) { - *p++ = 0x0; - } + volatile void *p = data; + memset(p, 0x0, len); #endif }