--- jabberd/mio.c 2006/08/10 14:54:02 1290 +++ jabberd/mio.c 2006/09/02 05:35:46 1291 @@ -469,6 +469,13 @@ return NULL; } + /* do not accept a higher fd than FD_SET, or FD_CLR can handle */ + if (fd >= FD_SETSIZE) { + log_warn(NULL, "could not accept incoming connection, maximum number of connections reached (%i)", FD_SETSIZE); + close(fd); + return NULL; + } + log_debug2(ZONE, LOGT_IO, "_mio_accept(%X) accepted fd #%d", m, fd); /* access and rate checks */