summaryrefslogtreecommitdiff
path: root/lib/libc/rpc/clnt_udp.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-20 23:47:47 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-20 23:47:47 +0000
commitdcb31c5f415dcfc2eccf8f1398ae1a2bbbb77b8e (patch)
treede82f64918370d7018661ab7dfe609ec5b09fae1 /lib/libc/rpc/clnt_udp.c
parent92d8e1f1481d4b16d9368429e59867c3c3e518d6 (diff)
memset 0; also fix for byte order botch in __svc_fdset handling; thanks to mw@openbsd.org
Diffstat (limited to 'lib/libc/rpc/clnt_udp.c')
-rw-r--r--lib/libc/rpc/clnt_udp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/rpc/clnt_udp.c b/lib/libc/rpc/clnt_udp.c
index fec0c0e0ee1..ee88b1c4c18 100644
--- a/lib/libc/rpc/clnt_udp.c
+++ b/lib/libc/rpc/clnt_udp.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: clnt_udp.c,v 1.6 1996/08/19 08:31:30 tholo Exp $";
+static char *rcsid = "$OpenBSD: clnt_udp.c,v 1.7 1996/08/20 23:47:40 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -234,10 +234,11 @@ clntudp_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
timeout = cu->cu_total; /* use default timeout */
if (cu->cu_sock+1 > FD_SETSIZE) {
- fds = (fd_set *)malloc(howmany(cu->cu_sock+1, NBBY));
+ int bytes = howmany(cu->cu_sock+1, NFDBITS) * sizeof(fd_mask);
+ fds = (fd_set *)malloc(bytes);
if (fds == NULL)
return (cu->cu_error.re_status = RPC_CANTSEND);
- memset(fds, '\0', howmany(cu->cu_sock+1, NBBY));
+ memset(fds, 0, bytes);
} else {
fds = &readfds;
FD_ZERO(fds);