# HG changeset patch # User Matt Johnston # Date 1495721986 -28800 # Node ID 4b1a807a31886f8988ee3dbb1bc0728755e7c7b7 # Parent 9891bc31a1b349f58b56fb423a4bb78c8b5e0460 Just use memset, it should'be be optimised out in a separate file diff -r 9891bc31a1b3 -r 4b1a807a3188 dbhelpers.c --- a/dbhelpers.c Thu May 25 00:12:07 2017 +0800 +++ b/dbhelpers.c Thu May 25 22:19:46 2017 +0800 @@ -9,16 +9,8 @@ #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 }