Browse Source

"Race-free because we're running single-threaded in a new

address space, and once allocated rs is never deallocated."
document the forkhandler to save reviewers time, with matthew
OPENBSD_5_6
deraadt 10 years ago
parent
commit
a4e31d35a0
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      src/lib/libc/crypt/arc4random.c

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

@ -1,4 +1,4 @@
/* $OpenBSD: arc4random.c,v 1.45 2014/07/16 00:18:54 deraadt Exp $ */
/* $OpenBSD: arc4random.c,v 1.46 2014/07/17 14:30:41 deraadt Exp $ */
/* /*
* Copyright (c) 1996, David Mazieres <dm@uun.org> * Copyright (c) 1996, David Mazieres <dm@uun.org>
@ -69,6 +69,10 @@ static inline void _rs_rekey(u_char *dat, size_t datlen);
static inline void static inline void
_rs_forkhandler(void) _rs_forkhandler(void)
{ {
/*
* Race-free because we're running single-threaded in a new
* address space, and once allocated rs is never deallocated.
*/
if (rs) if (rs)
rs->rs_count = 0; rs->rs_count = 0;
} }


Loading…
Cancel
Save