(mini_inetd): check that fds are not too large to select on
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9108 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -103,6 +103,8 @@ mini_inetd (int port)
|
|||||||
err (1, "bind");
|
err (1, "bind");
|
||||||
if (listen (fds[i], SOMAXCONN) < 0)
|
if (listen (fds[i], SOMAXCONN) < 0)
|
||||||
err (1, "listen");
|
err (1, "listen");
|
||||||
|
if (fds[i] >= FD_SETSIZE)
|
||||||
|
errx (1, "fd too large");
|
||||||
FD_SET(fds[i], &orig_read_set);
|
FD_SET(fds[i], &orig_read_set);
|
||||||
max_fd = max(max_fd, fds[i]);
|
max_fd = max(max_fd, fds[i]);
|
||||||
++i;
|
++i;
|
||||||
|
Reference in New Issue
Block a user