X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsys-linux.c;h=099db535357fb8211928fd545143a4e2d68e1476;hb=31b9087e92f1d0ecf87dc05c2ff4704be7b19870;hp=bf6db3285a81a9a6cebe728476e600ea71dee3f7;hpb=f53a48eb9d74db3c71938e114b7f489c339bc003;p=ppp.git diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index bf6db32..099db53 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -485,6 +485,7 @@ int generic_establish_ppp (int fd) error("Couldn't reopen /dev/ppp: %m"); goto err; } + (void) fcntl(fd, F_SETFD, FD_CLOEXEC); if (ioctl(fd, PPPIOCATTCHAN, &chindex) < 0) { error("Couldn't attach to channel %d: %m", chindex); goto err_close; @@ -1050,6 +1051,8 @@ void wait_input(struct timeval *timo) */ void add_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;