srandomdev: use stack junk value in the fallback code too
This commit is contained in:
parent
6b195d32a1
commit
f2305d469b
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue