diff --git a/ChangeLog b/ChangeLog index 6ee7c0014..7e416859f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20101204 + - (djm) [openbsd-compat/bindresvport.c] Use arc4random_uniform(range) + instead of (arc4random() % range) + 20101201 - OpenBSD CVS Sync - deraadt@cvs.openbsd.org 2010/11/20 05:12:38 diff --git a/openbsd-compat/bindresvport.c b/openbsd-compat/bindresvport.c index c0d5bdb5c..c89f21403 100644 --- a/openbsd-compat/bindresvport.c +++ b/openbsd-compat/bindresvport.c @@ -89,7 +89,7 @@ bindresvport_sa(int sd, struct sockaddr *sa) port = ntohs(*portp); if (port == 0) - port = (arc4random() % NPORTS) + STARTPORT; + port = arc4random_uniform(NPORTS) + STARTPORT; /* Avoid warning */ error = -1;