(process_rings): check that fds are not too large to select on

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9104 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2000-10-08 13:29:13 +00:00
parent c7ed81d0d1
commit 4fa6a49208

View File

@@ -774,6 +774,13 @@ process_rings(int netin,
int returnValue = 0; int returnValue = 0;
static struct timeval TimeValue = { 0 }; static struct timeval TimeValue = { 0 };
if (netin >= FD_SETSIZE
|| netout >= FD_SETSIZE
|| netex >= FD_SETSIZE
|| ttyin >= FD_SETSIZE
|| ttyout >= FD_SETSIZE)
errx (1, "fd too large");
if (netout) { if (netout) {
FD_SET(net, &obits); FD_SET(net, &obits);
} }
@@ -791,7 +798,7 @@ process_rings(int netin,
FD_SET(net, &xbits); FD_SET(net, &xbits);
} }
#endif #endif
if ((c = select(16, &ibits, &obits, &xbits, if ((c = select(FD_SETSIZE, &ibits, &obits, &xbits,
(poll == 0)? (struct timeval *)0 : &TimeValue)) < 0) { (poll == 0)? (struct timeval *)0 : &TimeValue)) < 0) {
if (c == -1) { if (c == -1) {
/* /*