summaryrefslogtreecommitdiff
path: root/openbsd-compat/arc4random.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2014-06-11 13:10:00 +1000
committerDarren Tucker <dtucker@zip.com.au>2014-06-11 13:10:00 +1000
commiteb012ac581fd0abc16ee86ee3a68cf07c8ce4d08 (patch)
treeb344233d11ebffc3ba78019dfd1ef7191e67eacd /openbsd-compat/arc4random.c
parentb9609fd86c623d6d440e630f5f9a63295f7aea20 (diff)
- (dtucker) [openbsd-compat/arc4random.c] Use explicit_bzero instead of an
assigment that might get optimized out. ok djm@
Diffstat (limited to 'openbsd-compat/arc4random.c')
-rw-r--r--openbsd-compat/arc4random.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsd-compat/arc4random.c b/openbsd-compat/arc4random.c
index eac073cc0..fa0d6301a 100644
--- a/openbsd-compat/arc4random.c
+++ b/openbsd-compat/arc4random.c
@@ -229,7 +229,7 @@ arc4random_buf(void *_buf, size_t n)
229 buf[i] = r & 0xff; 229 buf[i] = r & 0xff;
230 r >>= 8; 230 r >>= 8;
231 } 231 }
232 i = r = 0; 232 explicit_bzero(&r, sizeof(r));
233} 233}
234#endif /* !defined(HAVE_ARC4RANDOM_BUF) && defined(HAVE_ARC4RANDOM) */ 234#endif /* !defined(HAVE_ARC4RANDOM_BUF) && defined(HAVE_ARC4RANDOM) */
235 235