Browse Source

clear a stack buffer with explicit_bzero

OPENBSD_5_6
tedu 10 years ago
parent
commit
54fc405fe7
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/lib/libc/crypt/arc4random.c

+ 2
- 2
src/lib/libc/crypt/arc4random.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: arc4random.c,v 1.28 2014/05/06 02:31:45 tedu Exp $ */
/* $OpenBSD: arc4random.c,v 1.29 2014/05/06 15:37:57 tedu Exp $ */
/*
* Copyright (c) 1996, David Mazieres <dm@uun.org>
@ -92,7 +92,7 @@ _rs_stir(void)
_rs_init(rnd, sizeof(rnd));
} else
_rs_rekey(rnd, sizeof(rnd));
memset(rnd, 0, sizeof(rnd));
explicit_bzero(rnd, sizeof(rnd));
/* invalidate rs_buf */
rs_have = 0;


Loading…
Cancel
Save