(add_new_tcp): check for the socket fd being too large to selct on

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9112 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2000-10-08 21:36:29 +00:00
parent 21c29c4974
commit 5d25e7e3ef

View File

@@ -530,6 +530,12 @@ add_new_tcp (struct descr *d, int parent, int child)
return;
}
if (s >= FD_SETSIZE) {
krb5_warnx(context, "socket FD too large");
close (s);
return;
}
d[child].s = s;
d[child].timeout = time(NULL) + TCP_TIMEOUT;
d[child].type = SOCK_STREAM;