X-Git-Url: https://git.saurik.com/apple/libinfo.git/blobdiff_plain/c6f155da1354232bd502882ef0490c98819efdf0..a0865d6380e4ae001b2f00dbe4199477660b93d4:/rpc.subproj/svc.c diff --git a/rpc.subproj/svc.c b/rpc.subproj/svc.c index fffefc0..a559c03 100644 --- a/rpc.subproj/svc.c +++ b/rpc.subproj/svc.c @@ -53,7 +53,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)svc.c 1.44 88/02/08 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)svc.c 2.4 88/08/11 4.0 RPCSRC";*/ -static char *rcsid = "$Id: svc.c,v 1.2 1999/10/14 21:56:54 wsanchez Exp $"; +static char *rcsid = "$Id: svc.c,v 1.3 2001/08/23 01:25:01 ajn Exp $"; #endif /* @@ -411,8 +411,11 @@ svc_getreqset(readfds) maskp = (u_long *)readfds->fds_bits; - for (sock = 0; sock < FD_SETSIZE; sock += NFDBITS) { + for (sock = 0; sock <= svc_maxfd; sock += NFDBITS) { for (mask = *maskp++; bit = ffs(mask); mask ^= (1 << (bit - 1))) { + if ((sock + bit) > (svc_maxfd + 1)) + /* if we're past our sockets */ + return; /* sock has input waiting */ xprt = xports[sock + bit - 1]; if (xprt == NULL)