]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
m_mysql Fix escaping strings longer than MAXBUF/2
[user/henk/code/inspircd.git] / src / users.cpp
index dbc3ea444a97b162d221bfbcb4f09717b12b6ea7..2305ba8ce333cf0cf374b67e49df18abaf46c0b6 100644 (file)
@@ -545,7 +545,12 @@ CullResult LocalUser::cull()
        // overwritten in UserManager::AddUser() with the real iterator so this check
        // is only a precaution currently.
        if (localuseriter != ServerInstance->Users->local_users.end())
+       {
+               ServerInstance->Users->local_count--;
                ServerInstance->Users->local_users.erase(localuseriter);
+       }
+       else
+               ServerInstance->Logs->Log("USERS", DEFAULT, "ERROR: LocalUserIter does not point to a valid entry for " + this->nick);
 
        ClearInvites();
        eh.cull();
@@ -840,6 +845,12 @@ void User::InvalidateCache()
 
 bool User::ChangeNick(const std::string& newnick, bool force)
 {
+       if (quitting)
+       {
+               ServerInstance->Logs->Log("USERS", DEFAULT, "ERROR: Attempted to change nick of a quitting user: " + this->nick);
+               return false;
+       }
+
        ModResult MOD_RESULT;
 
        if (force)