]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/userprocess.cpp
Test fixes for cpu eating issue
[user/henk/code/inspircd.git] / src / userprocess.cpp
index 00b08689389a697892bd30e9cf05e7e96c21356a..67cd3cca900a3deb2d8c3c1db189e4ecbdc77ab4 100644 (file)
@@ -102,7 +102,7 @@ void ProcessUser(userrec* cu)
                }
                catch (ModuleException& modexcept)
                {
-                       log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
+                       log(DEBUG,"Module exception caught: %s",modexcept.GetReason());
                }
 
                if (MOD_RESULT < 0)
@@ -136,6 +136,8 @@ void ProcessUser(userrec* cu)
 
                /*
                 * XXX - potential replacement for the below using my beloved pointers. --w00t
+                * XXX - no garauntee there's not \0's in the middle of the data,
+                *       and no reason for it to be terminated either. -- Om
                 *
                 * for (char *c = data; data && *data; data++)
                 * {
@@ -317,7 +319,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;
@@ -494,5 +496,3 @@ void LoadAllModules(InspIRCd* ServerInstance)
 
        log(DEFAULT,"Total loaded modules: %lu",(unsigned long)MODCOUNT+1);
 }
-
-