From c190d28aad7485cfc9a34d8b89beb3270720338a Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 14 Mar 2006 00:48:31 +0000 Subject: Sanity check, writing to array[-1] is not clever and not profitable. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3711 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/userprocess.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/userprocess.cpp b/src/userprocess.cpp index 00b086893..01462d47c 100644 --- a/src/userprocess.cpp +++ b/src/userprocess.cpp @@ -317,7 +317,7 @@ void DoSocketTimeouts(time_t TIME) for (std::vector::iterator a = module_sockets.begin(); a < module_sockets.end(); a++) { InspSocket* s = (InspSocket*)*a; - if ((s) && (socket_ref[s->GetFd()] != NULL) && (s->Timeout(TIME))) + if ((s) && (s->GetFd() >= 0) && (s->GetFd() < MAX_DESCRIPTORS) && (socket_ref[s->GetFd()] != NULL) && (s->Timeout(TIME))) { log(DEBUG,"userprocess.cpp: Socket poll returned false, close and bail"); socket_ref[s->GetFd()] = NULL; -- cgit v1.2.3