- (djm) [openbsd-compat/bindresvport.c] Use arc4random_uniform(range)

instead of (arc4random() % range)
This commit is contained in:
Damien Miller 2010-12-03 10:50:26 +11:00
parent d925dcd8a5
commit d89745b9e7
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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;