diff options
Diffstat (limited to 'lib/libc/string/explicit_bzero.c')
-rw-r--r-- | lib/libc/string/explicit_bzero.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/libc/string/explicit_bzero.c b/lib/libc/string/explicit_bzero.c index 5124df23caf..3e33ca85b83 100644 --- a/lib/libc/string/explicit_bzero.c +++ b/lib/libc/string/explicit_bzero.c @@ -1,16 +1,19 @@ -/* $OpenBSD: explicit_bzero.c,v 1.2 2014/06/10 04:17:37 deraadt Exp $ */ +/* $OpenBSD: explicit_bzero.c,v 1.3 2014/06/21 02:34:26 matthew Exp $ */ /* * Public domain. - * Written by Ted Unangst + * Written by Matthew Dempsky. */ #include <string.h> -/* - * explicit_bzero - don't let the compiler optimize away bzero - */ +__attribute__((weak)) void +__explicit_bzero_hook(void *buf, size_t len) +{ +} + void -explicit_bzero(void *p, size_t n) +explicit_bzero(void *buf, size_t len) { - bzero(p, n); + memset(buf, 0, len); + __explicit_bzero_hook(buf, len); } |