diff options
author | nectar <nectar@FreeBSD.org> | 2002-09-17 15:52:35 +0000 |
---|---|---|
committer | nectar <nectar@FreeBSD.org> | 2002-09-17 15:52:35 +0000 |
commit | 5477187d2c65cc2c1f2d3541e4947a034717ce09 (patch) | |
tree | 5630375ce9fde02e5829ae0118b2ee0f83e13535 | |
parent | f1acb2c2a81212d37481efc890fea81a60c4a896 (diff) | |
download | FreeBSD-src-5477187d2c65cc2c1f2d3541e4947a034717ce09.zip FreeBSD-src-5477187d2c65cc2c1f2d3541e4947a034717ce09.tar.gz |
Check for FD_SET overruns.
Approved by: peter
-rw-r--r-- | usr.sbin/pppd/sys-bsd.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/usr.sbin/pppd/sys-bsd.c b/usr.sbin/pppd/sys-bsd.c index a5dcd16..d524f02 100644 --- a/usr.sbin/pppd/sys-bsd.c +++ b/usr.sbin/pppd/sys-bsd.c @@ -566,6 +566,10 @@ wait_input(timo) fd_set ready; int n; + if (ttyfd >= FD_SETSIZE) { + syslog(LOG_ERR, "descriptor too big"); + die(1); + } FD_ZERO(&ready); FD_SET(ttyfd, &ready); n = select(ttyfd+1, &ready, NULL, &ready, timo); @@ -588,6 +592,10 @@ wait_loop_output(timo) fd_set ready; int n; + if (loop_master >= FD_SETSIZE) { + syslog(LOG_ERR, "descriptor too big"); + die(1); + } FD_ZERO(&ready); FD_SET(loop_master, &ready); n = select(loop_master + 1, &ready, NULL, &ready, timo); |