summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-06-27 21:31:12 +0000
committerderaadt <deraadt@openbsd.org>2014-06-27 21:31:12 +0000
commit98a6c07de4c0d7cee74a6665143b4382f03373e4 (patch)
tree6e676175c2cd397032f8253da49dec9d7b782ed9 /lib
parentCleanup ioctl.2 slightly: (diff)
downloadwireguard-openbsd-98a6c07de4c0d7cee74a6665143b4382f03373e4.tar.xz
wireguard-openbsd-98a6c07de4c0d7cee74a6665143b4382f03373e4.zip
re-init and init code paths are now more shared, so the getpid()-based
portable code path must handle that; with brent cook
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/crypt/arc4random.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/crypt/arc4random.c b/lib/libc/crypt/arc4random.c
index ee47b2df340..fd8570565eb 100644
--- a/lib/libc/crypt/arc4random.c
+++ b/lib/libc/crypt/arc4random.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arc4random.c,v 1.38 2014/06/26 19:23:15 deraadt Exp $ */
+/* $OpenBSD: arc4random.c,v 1.39 2014/06/27 21:31:12 deraadt Exp $ */
/*
* Copyright (c) 1996, David Mazieres <dm@uun.org>
@@ -120,7 +120,8 @@ _rs_stir_if_needed(size_t len)
/* If a system lacks MAP_INHERIT_ZERO, resort to getpid() */
if (_rs_pid == 0 || _rs_pid != pid) {
_rs_pid = pid;
- rs->rs_count = 0;
+ if (rs)
+ rs->rs_count = 0;
}
#endif
if (!rs || rs->rs_count <= len)