X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Ftty.c;h=efc92ec0fd34cbf8da3304c02db6ae70f8aa20e1;hb=5116fdc189652e3c39e2581a01b7ff5b4cefd514;hp=803d8ba02edecad13d30d4cc38517d7731b4f56a;hpb=f53a48eb9d74db3c71938e114b7f489c339bc003;p=ppp.git diff --git a/pppd/tty.c b/pppd/tty.c index 803d8ba..efc92ec 100644 --- a/pppd/tty.c +++ b/pppd/tty.c @@ -73,7 +73,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: tty.c,v 1.8 2002/12/04 23:03:33 paulus Exp $" +#define RCSID "$Id: tty.c,v 1.9 2002/12/06 12:06:45 paulus Exp $" #include #include @@ -992,6 +992,13 @@ charshunt(ifd, ofd, record_file) signal(SIGXFSZ, SIG_DFL); #endif + /* + * Check that the fds won't overrun the fd_sets + */ + if (ifd >= FD_SETSIZE || ofd >= FD_SETSIZE || pty_master >= FD_SETSIZE) + fatal("internal error: file descriptor too large (%d, %d, %d)", + ifd, ofd, pty_master); + /* * Open the record file if required. */