From b3bc7c4e0de0f2b82ba5379e8f5a6a54549d565f Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sun, 27 Nov 2005 21:45:21 +0000 Subject: make lynx(1) to use arc4random(4) instead of other random functions; avoid a segfault by checking the value of TAB TO; from Alexey Dobriyan ; pushed by deraadt@ --- gnu/usr.bin/lynx/WWW/Library/Implementation/HTTP.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gnu/usr.bin/lynx/WWW') diff --git a/gnu/usr.bin/lynx/WWW/Library/Implementation/HTTP.c b/gnu/usr.bin/lynx/WWW/Library/Implementation/HTTP.c index 93fe4bb489e..fd3e11f76ac 100644 --- a/gnu/usr.bin/lynx/WWW/Library/Implementation/HTTP.c +++ b/gnu/usr.bin/lynx/WWW/Library/Implementation/HTTP.c @@ -130,7 +130,9 @@ PUBLIC void HTSSLInitPRNG NOARGS RAND_seed((unsigned char *)&pid, sizeof(pid)); /* Initialize system's random number generator */ RAND_bytes((unsigned char *)&seed, sizeof(long)); +#if !defined(__OpenBSD__) lynx_srand(seed); +#endif while (RAND_status() == 0) { /* Repeatedly seed the PRNG using the system's random number generator until it has been seeded with enough data */ l = lynx_rand(); -- cgit v1.2.3