diff options
author | 2002-08-09 02:27:16 +0000 | |
---|---|---|
committer | 2002-08-09 02:27:16 +0000 | |
commit | 46bbf5f70ebe85277ddbcaa875f369247b00a6f5 (patch) | |
tree | fa8a2e4191df0703a61cfe1c53918ce06f8e87f6 | |
parent | Correct the size arg to memset() so argv will be cleared correctly; art@ ok. (diff) | |
download | wireguard-openbsd-46bbf5f70ebe85277ddbcaa875f369247b00a6f5.tar.xz wireguard-openbsd-46bbf5f70ebe85277ddbcaa875f369247b00a6f5.zip |
die if fd_set overruns.
-rw-r--r-- | usr.sbin/map-mbone/mapper.c | 2 | ||||
-rw-r--r-- | usr.sbin/mrouted/main.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/map-mbone/mapper.c b/usr.sbin/map-mbone/mapper.c index 930284698c9..f276868c126 100644 --- a/usr.sbin/map-mbone/mapper.c +++ b/usr.sbin/map-mbone/mapper.c @@ -939,6 +939,8 @@ int main(argc, argv) int count, recvlen, dummy = 0; FD_ZERO(&fds); + if (igmp_socket >= FD_SETSIZE) + log(LOG_ERR, 0, "descriptor too big"); FD_SET(igmp_socket, &fds); tv.tv_sec = timeout; diff --git a/usr.sbin/mrouted/main.c b/usr.sbin/mrouted/main.c index edebd6f50e1..da9bd956ddb 100644 --- a/usr.sbin/mrouted/main.c +++ b/usr.sbin/mrouted/main.c @@ -30,7 +30,7 @@ #ifndef lint static char rcsid[] = - "@(#) $Id: main.c,v 1.9 2002/02/19 19:39:40 millert Exp $"; + "@(#) $Id: main.c,v 1.10 2002/08/09 02:27:16 itojun Exp $"; #endif extern char *configfilename; @@ -278,9 +278,13 @@ usage: fprintf(stderr, (void)signal(SIGQUIT, dump); FD_ZERO(&readers); + if (igmp_socket >= FD_SETSIZE) + log(LOG_ERR, 0, "descriptor too big"); FD_SET(igmp_socket, &readers); nfds = igmp_socket + 1; for (i = 0; i < nhandlers; i++) { + if (ihandlers[i].fd >= FD_SETSIZE) + log(LOG_ERR, 0, "descriptor too big"); FD_SET(ihandlers[i].fd, &readers); if (ihandlers[i].fd >= nfds) nfds = ihandlers[i].fd + 1; |