summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortedu <>2014-05-06 15:37:57 +0000
committertedu <>2014-05-06 15:37:57 +0000
commit53bc8d618744d3ebe81cc3c4ac9a79d5cdbd37d1 (patch)
treeaac577b089c948f4c380ccb66a772006e58393d2
parent2518b24aa4315d557b967bff48dfc9efed909569 (diff)
downloadopenbsd-53bc8d618744d3ebe81cc3c4ac9a79d5cdbd37d1.tar.gz
openbsd-53bc8d618744d3ebe81cc3c4ac9a79d5cdbd37d1.tar.bz2
openbsd-53bc8d618744d3ebe81cc3c4ac9a79d5cdbd37d1.zip
clear a stack buffer with explicit_bzero
-rw-r--r--src/lib/libc/crypt/arc4random.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libc/crypt/arc4random.c b/src/lib/libc/crypt/arc4random.c
index 57acc0d56d..57decde1f8 100644
--- a/src/lib/libc/crypt/arc4random.c
+++ b/src/lib/libc/crypt/arc4random.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: arc4random.c,v 1.28 2014/05/06 02:31:45 tedu Exp $ */ 1/* $OpenBSD: arc4random.c,v 1.29 2014/05/06 15:37:57 tedu Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996, David Mazieres <dm@uun.org> 4 * Copyright (c) 1996, David Mazieres <dm@uun.org>
@@ -92,7 +92,7 @@ _rs_stir(void)
92 _rs_init(rnd, sizeof(rnd)); 92 _rs_init(rnd, sizeof(rnd));
93 } else 93 } else
94 _rs_rekey(rnd, sizeof(rnd)); 94 _rs_rekey(rnd, sizeof(rnd));
95 memset(rnd, 0, sizeof(rnd)); 95 explicit_bzero(rnd, sizeof(rnd));
96 96
97 /* invalidate rs_buf */ 97 /* invalidate rs_buf */
98 rs_have = 0; 98 rs_have = 0;