diff options
author | Robert Nagy <robert@cvs.openbsd.org> | 2005-11-27 21:45:21 +0000 |
---|---|---|
committer | Robert Nagy <robert@cvs.openbsd.org> | 2005-11-27 21:45:21 +0000 |
commit | b3bc7c4e0de0f2b82ba5379e8f5a6a54549d565f (patch) | |
tree | 8353c6429564ad8bdb7cd0fef7faf0ab1b3c1954 /gnu/usr.bin/lynx/aclocal.m4 | |
parent | b2fafc5cbfb504a474834fb4200f4bce2e91a1c5 (diff) |
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 <adobriyan@gmail.com>; pushed by deraadt@
Diffstat (limited to 'gnu/usr.bin/lynx/aclocal.m4')
-rw-r--r-- | gnu/usr.bin/lynx/aclocal.m4 | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gnu/usr.bin/lynx/aclocal.m4 b/gnu/usr.bin/lynx/aclocal.m4 index 0d9f34f1331..e3bafacf77b 100644 --- a/gnu/usr.bin/lynx/aclocal.m4 +++ b/gnu/usr.bin/lynx/aclocal.m4 @@ -3277,7 +3277,7 @@ dnl which usually is only 16-bits. AC_DEFUN([CF_SRAND],[ AC_CACHE_CHECK(for random-integer functions, cf_cv_srand_func,[ cf_cv_srand_func=unknown -for cf_func in srandom/random srand48/lrand48 srand/rand +for cf_func in arc4random srandom/random srand48/lrand48 srand/rand do cf_srand_func=`echo $cf_func | sed -e 's%/.*%%'` cf_rand_func=`echo $cf_func | sed -e 's%.*/%%'` @@ -3288,7 +3288,7 @@ AC_TRY_LINK([ #ifdef HAVE_LIMITS_H #include <limits.h> #endif -],[long seed = 1; $cf_srand_func(seed); seed = $cf_rand_func()], +],[long seed = 1; seed = $cf_rand_func()], [cf_cv_srand_func=$cf_func break]) done @@ -3300,6 +3300,10 @@ if test "$cf_cv_srand_func" != unknown ; then cf_cv_rand_max=RAND_MAX cf_rand_max=16 ;; + arc4random) + cf_cv_rand_max=0xFFFFFFFFUL + cf_rand_max=32 + ;; *) cf_cv_rand_max=INT_MAX cf_rand_max=31 |