summaryrefslogtreecommitdiff
blob: 338369c698ce84aadae309456dbfb23ea1bf22f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--- 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 */