summaryrefslogtreecommitdiff
path: root/src/userprocess.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-14 00:48:31 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-14 00:48:31 +0000
commitc190d28aad7485cfc9a34d8b89beb3270720338a (patch)
treea7171433351eaebd49058d32ba4d9f5aeaa1b18b /src/userprocess.cpp
parentcf9e5918ecc2c1f1557913b4c3e39937c7cd55a9 (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/userprocess.cpp')
-rw-r--r--src/userprocess.cpp2
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;