From 4b0c3014f317361ea9fb4cb89b9629bb415c78db Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 5 May 2004 09:52:22 +0000 Subject: Fixed crash that only slug can replicate git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@789 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 018bdf133..cb1e5cea7 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -3333,7 +3333,8 @@ int InspIRCd(void) for (int x = 0; x != UDPportCount; x++) { - FD_SET(me[x]->fd, &serverfds); + if (me[x]) + FD_SET(me[x]->fd, &serverfds); } tvs.tv_usec = 0; @@ -3344,7 +3345,7 @@ int InspIRCd(void) { for (int x = 0; x != UDPportCount; x++) { - if (FD_ISSET (me[x]->fd, &serverfds)) + if ((me[x]) && (FD_ISSET (me[x]->fd, &serverfds))) { char remotehost[MAXBUF],resolved[MAXBUF]; length = sizeof (client); @@ -3365,7 +3366,7 @@ int InspIRCd(void) { std::deque msgs; msgs.clear(); - if (me[x]->RecvPacket(msgs, tcp_host)) + if ((me[x]) && (me[x]->RecvPacket(msgs, tcp_host))) { for (int ctr = 0; ctr < msgs.size(); ctr++) { -- cgit v1.2.3