diff options
author | Damien Miller <djm@mindrot.org> | 2010-12-03 10:50:26 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2010-12-03 10:50:26 +1100 |
commit | d89745b9e7e2048c13b0173eadc2d41e23b6a79d (patch) | |
tree | c155f820167a055d9ce2425491aeb91204dfa061 | |
parent | d925dcd8a5d1a3070061006788352bed93260582 (diff) |
- (djm) [openbsd-compat/bindresvport.c] Use arc4random_uniform(range)
instead of (arc4random() % range)
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | openbsd-compat/bindresvport.c | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -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 c0d5bdb5..c89f2140 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; |