From 20e3875e35b8e4801ef22eb72de8508c0879d518 Mon Sep 17 00:00:00 2001 From: skotlex Date: Sun, 1 Apr 2007 16:25:34 +0000 Subject: - Modified waiting_disconnect on the login server to hold the timer id of the 'set offline' timer. - connect_client will no longer accept connections when their number is greater than FD_SETSIZE to prevent crashes on packet parsing. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10110 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/common/socket.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/common') diff --git a/src/common/socket.c b/src/common/socket.c index d816767ae..4e001c512 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -248,6 +248,12 @@ int connect_client(int listen_fd) return -1; } + if ( fd >= FD_SETSIZE ) + { //More connections than we can handle! + ShowError("accept failed. Received socket #%d is greater than can we handle! Increase the value of FD_SETSIZE (%d) for your OS to fix this!\n", fd, FD_SETSIZE); + closesocket(fd); + return -1; + } setsocketopts(fd); set_nonblocking(fd, 1); -- cgit v1.2.3-70-g09d2