diff options
author | ache <ache@FreeBSD.org> | 1997-06-15 18:23:19 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1997-06-15 18:23:19 +0000 |
commit | 898607164bdf15e11a347b104c06a10f000200dd (patch) | |
tree | 3a1b7c59ec83b4b4041d9e26a57b2bd25b3c7ec5 /lib/libc | |
parent | eb8e1f5e4ef9200ddb9a6b5da00a52e14013f8f8 (diff) | |
download | FreeBSD-src-898607164bdf15e11a347b104c06a10f000200dd.zip FreeBSD-src-898607164bdf15e11a347b104c06a10f000200dd.tar.gz |
srandomdev: use stack junk value in the fallback code too
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/stdlib/random.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/stdlib/random.c b/lib/libc/stdlib/random.c index 2c4e234..4737e40 100644 --- a/lib/libc/stdlib/random.c +++ b/lib/libc/stdlib/random.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: random.c,v 1.8 1997/03/29 19:55:03 ache Exp $ + * $Id: random.c,v 1.9 1997/06/14 00:13:56 ache Exp $ * */ @@ -307,9 +307,10 @@ srandomdev() if (!done) { struct timeval tv; + unsigned long junk; gettimeofday(&tv, NULL); - srandom(getpid() ^ tv.tv_sec ^ tv.tv_usec); + srandom(getpid() ^ tv.tv_sec ^ tv.tv_usec ^ junk); return; } |