X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsys-bsd.c;h=da186a44bd1c738ab4148cd9045c483e07b63cfe;hp=2ae843ad5bfd56a126a37268438e21a01cdae346;hb=f9f667ee187be5d34ac94f11bf366dd218191122;hpb=f53a48eb9d74db3c71938e114b7f489c339bc003 diff --git a/pppd/sys-bsd.c b/pppd/sys-bsd.c index 2ae843a..da186a4 100644 --- a/pppd/sys-bsd.c +++ b/pppd/sys-bsd.c @@ -11,16 +11,11 @@ * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The name(s) of the authors of this software must not be used to + * 2. The name(s) of the authors of this software must not be used to * endorse or promote products derived from this software without * prior written permission. * - * 4. Redistributions of any form whatsoever must retain the following + * 3. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by Paul Mackerras * ". @@ -74,7 +69,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: sys-bsd.c,v 1.48 2002/12/04 23:03:32 paulus Exp $" +#define RCSID "$Id: sys-bsd.c,v 1.50 2004/11/04 10:02:26 paulus Exp $" /* $NetBSD: sys-bsd.c,v 1.1.1.3 1997/09/26 18:53:04 christos Exp $ */ /* @@ -646,6 +641,8 @@ wait_input(timo) void add_fd(fd) int fd; { + if (fd >= FD_SETSIZE) + fatal("internal error: file descriptor too large (%d)", fd); FD_SET(fd, &in_fds); if (fd > max_in_fd) max_in_fd = fd; @@ -674,6 +671,8 @@ wait_loop_output(timo) int n; FD_ZERO(&ready); + if (loop_master >= FD_SETSIZE) + fatal("internal error: file descriptor too large (%d)", loop_master); FD_SET(loop_master, &ready); n = select(loop_master + 1, &ready, NULL, &ready, timo); if (n < 0 && errno != EINTR)