diff options
author | Matt Johnston <matt@ucc.asn.au> | 2013-03-21 21:23:34 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2013-03-21 21:23:34 +0800 |
commit | a5e6270464612acb8990cd349ee753b0c1e30f7d (patch) | |
tree | a646e7302e520766b8dd7a074c32451cf7113be8 | |
parent | b9e4659f2a3c2258eeaed6d0b5d3e1c1483c77f8 (diff) | |
download | dropbear-a5e6270464612acb8990cd349ee753b0c1e30f7d.tar.gz |
Make sure "struct timeval" is initialised on OS X to avoid valgrind warnings
-rw-r--r-- | random.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -217,6 +217,9 @@ void seedrandom() { pid = getpid(); sha1_process(&hs, (void*)&pid, sizeof(pid)); + // gettimeofday() doesn't completely fill out struct timeval on + // OS X (10.8.3), avoid valgrind warnings by clearing it first + memset(&tv, 0x0, sizeof(tv)); gettimeofday(&tv, NULL); sha1_process(&hs, (void*)&tv, sizeof(tv)); |