summaryrefslogtreecommitdiff
path: root/lib/libc/rpc/clnt_tcp.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_tcp.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_tcp.c')
-rw-r--r--lib/libc/rpc/clnt_tcp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/rpc/clnt_tcp.c b/lib/libc/rpc/clnt_tcp.c
index f76cf0203ab..e8c65ecabf0 100644
--- a/lib/libc/rpc/clnt_tcp.c
+++ b/lib/libc/rpc/clnt_tcp.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: clnt_tcp.c,v 1.6 1996/08/19 08:31:29 tholo Exp $";
+static char *rcsid = "$OpenBSD: clnt_tcp.c,v 1.7 1996/08/20 23:47:37 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -407,10 +407,11 @@ readtcp(ct, buf, len)
return (0);
if (ct->ct_sock+1 > FD_SETSIZE) {
- fds = (fd_set *)malloc(howmany(ct->ct_sock+1, NBBY));
+ int bytes = howmany(ct->ct_sock+1, NFDBITS) * sizeof(fd_mask);
+ fds = (fd_set *)malloc(bytes);
if (fds == NULL)
return (-1);
- memset(fds, '\0', howmany(ct->ct_sock+1, NBBY));
+ memset(fds, 0, bytes);
} else {
fds = &readfds;
FD_ZERO(fds);