diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | openbsd-compat/bindresvport.c | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -1,3 +1,7 @@ | |||
1 | 20101204 | ||
2 | - (djm) [openbsd-compat/bindresvport.c] Use arc4random_uniform(range) | ||
3 | instead of (arc4random() % range) | ||
4 | |||
1 | 20101201 | 5 | 20101201 |
2 | - OpenBSD CVS Sync | 6 | - OpenBSD CVS Sync |
3 | - deraadt@cvs.openbsd.org 2010/11/20 05:12:38 | 7 | - 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) | |||
89 | 89 | ||
90 | port = ntohs(*portp); | 90 | port = ntohs(*portp); |
91 | if (port == 0) | 91 | if (port == 0) |
92 | port = (arc4random() % NPORTS) + STARTPORT; | 92 | port = arc4random_uniform(NPORTS) + STARTPORT; |
93 | 93 | ||
94 | /* Avoid warning */ | 94 | /* Avoid warning */ |
95 | error = -1; | 95 | error = -1; |