diff options
Diffstat (limited to 'src/lib/libc/net/rcmd.c')
| -rw-r--r-- | src/lib/libc/net/rcmd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libc/net/rcmd.c b/src/lib/libc/net/rcmd.c index 468c93eb63..00a554a0a2 100644 --- a/src/lib/libc/net/rcmd.c +++ b/src/lib/libc/net/rcmd.c | |||
| @@ -34,7 +34,7 @@ | |||
| 34 | */ | 34 | */ |
| 35 | 35 | ||
| 36 | #if defined(LIBC_SCCS) && !defined(lint) | 36 | #if defined(LIBC_SCCS) && !defined(lint) |
| 37 | static char *rcsid = "$OpenBSD: rcmd.c,v 1.22 1997/06/03 22:43:42 deraadt Exp $"; | 37 | static char *rcsid = "$OpenBSD: rcmd.c,v 1.23 1997/06/04 03:18:40 dm Exp $"; |
| 38 | #endif /* LIBC_SCCS and not lint */ | 38 | #endif /* LIBC_SCCS and not lint */ |
| 39 | 39 | ||
| 40 | #include <sys/param.h> | 40 | #include <sys/param.h> |
| @@ -163,11 +163,11 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p) | |||
| 163 | char num[8]; | 163 | char num[8]; |
| 164 | int s2 = rresvport(&lport), s3; | 164 | int s2 = rresvport(&lport), s3; |
| 165 | int len = sizeof(from); | 165 | int len = sizeof(from); |
| 166 | int fdssize = howmany(MAX(s, s2)+1, NFDBITS) * sizeof(fd_mask); | ||
| 166 | 167 | ||
| 167 | if (s2 < 0) | 168 | if (s2 < 0) |
| 168 | goto bad; | 169 | goto bad; |
| 169 | readsp = (fd_set *)malloc(howmany(MAX(s, s2)+1, NFDBITS) * | 170 | readsp = (fd_set *)malloc(fdssize); |
| 170 | sizeof(fd_mask)); | ||
| 171 | if (readsp == NULL) | 171 | if (readsp == NULL) |
| 172 | goto bad; | 172 | goto bad; |
| 173 | listen(s2, 1); | 173 | listen(s2, 1); |
| @@ -180,7 +180,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p) | |||
| 180 | goto bad; | 180 | goto bad; |
| 181 | } | 181 | } |
| 182 | again: | 182 | again: |
| 183 | FD_ZERO(readsp); | 183 | bzero(readsp,fdssize); |
| 184 | FD_SET(s, readsp); | 184 | FD_SET(s, readsp); |
| 185 | FD_SET(s2, readsp); | 185 | FD_SET(s2, readsp); |
| 186 | errno = 0; | 186 | errno = 0; |
