diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-14 00:48:31 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-14 00:48:31 +0000 |
commit | c190d28aad7485cfc9a34d8b89beb3270720338a (patch) | |
tree | a7171433351eaebd49058d32ba4d9f5aeaa1b18b /src | |
parent | cf9e5918ecc2c1f1557913b4c3e39937c7cd55a9 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/userprocess.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<InspSocket*>::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; |