summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ftp-proxy/ftp-proxy.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2008-04-13 00:22:16 +0000
committerdjm <djm@openbsd.org>2008-04-13 00:22:16 +0000
commit66ad965f4873a0970dea06fb53c307b8385e5a94 (patch)
tree4afc515a23e6b6330f9c5d210162905120f9188a /usr.sbin/ftp-proxy/ftp-proxy.c
parentbring in changes as found in libossaudio (diff)
downloadwireguard-openbsd-66ad965f4873a0970dea06fb53c307b8385e5a94.tar.xz
wireguard-openbsd-66ad965f4873a0970dea06fb53c307b8385e5a94.zip
Use arc4random_buf() when requesting more than a single word of output
Use arc4random_uniform() when the desired random number upper bound is not a power of two ok deraadt@ millert@
Diffstat (limited to 'usr.sbin/ftp-proxy/ftp-proxy.c')
-rw-r--r--usr.sbin/ftp-proxy/ftp-proxy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ftp-proxy/ftp-proxy.c b/usr.sbin/ftp-proxy/ftp-proxy.c
index 1a3bdf55fbd..cf697b56614 100644
--- a/usr.sbin/ftp-proxy/ftp-proxy.c
+++ b/usr.sbin/ftp-proxy/ftp-proxy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftp-proxy.c,v 1.16 2008/02/26 18:52:53 henning Exp $ */
+/* $OpenBSD: ftp-proxy.c,v 1.17 2008/04/13 00:22:17 djm Exp $ */
/*
* Copyright (c) 2004, 2005 Camiel Dobbelaar, <cd@sentia.nl>
@@ -834,8 +834,8 @@ u_int16_t
pick_proxy_port(void)
{
/* Random should be good enough for avoiding port collisions. */
- return (IPPORT_HIFIRSTAUTO + (arc4random() %
- (IPPORT_HILASTAUTO - IPPORT_HIFIRSTAUTO)));
+ return (IPPORT_HIFIRSTAUTO +
+ arc4random_uniform(IPPORT_HILASTAUTO - IPPORT_HIFIRSTAUTO));
}
void