summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libc/string/explicit_bzero.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/lib/libc/string/explicit_bzero.c b/src/lib/libc/string/explicit_bzero.c
index 5124df23ca..3e33ca85b8 100644
--- a/src/lib/libc/string/explicit_bzero.c
+++ b/src/lib/libc/string/explicit_bzero.c
@@ -1,16 +1,19 @@
1/* $OpenBSD: explicit_bzero.c,v 1.2 2014/06/10 04:17:37 deraadt Exp $ */ 1/* $OpenBSD: explicit_bzero.c,v 1.3 2014/06/21 02:34:26 matthew Exp $ */
2/* 2/*
3 * Public domain. 3 * Public domain.
4 * Written by Ted Unangst 4 * Written by Matthew Dempsky.
5 */ 5 */
6 6
7#include <string.h> 7#include <string.h>
8 8
9/* 9__attribute__((weak)) void
10 * explicit_bzero - don't let the compiler optimize away bzero 10__explicit_bzero_hook(void *buf, size_t len)
11 */ 11{
12}
13
12void 14void
13explicit_bzero(void *p, size_t n) 15explicit_bzero(void *buf, size_t len)
14{ 16{
15 bzero(p, n); 17 memset(buf, 0, len);
18 __explicit_bzero_hook(buf, len);
16} 19}