diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-25 15:25:32 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-25 15:25:32 +0000 |
commit | 393c1afdd7bfede2b7f489d7ceb000c909c0fccf (patch) | |
tree | 5b8d58a9f51c3511d7d9ccc9da7674e8df69cd2d /src/users.cpp | |
parent | 7b3105e5d4ea1877f8c30daaf069839ea890752d (diff) |
this should fix any of the crashes w00t outlined where User::MyClass == NULL.
The simplest fix seems to be that if the user has no class, skip all the code that uses the class values.
This makes sense because the only situation where User::MyClass == NULL is when they arent authorised to connect and are being quit so checking flood levels and max sendq etc are irrelevent.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8358 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r-- | src/users.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/users.cpp b/src/users.cpp index 1affa67db..dbe179989 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -495,7 +495,7 @@ bool User::AddBuffer(std::string a) if (a.length()) recvq.append(a); - if (recvq.length() > (unsigned)this->MyClass->GetRecvqMax()) + if (this->MyClass && (recvq.length() > this->MyClass->GetRecvqMax())) { this->SetWriteError("RecvQ exceeded"); ServerInstance->WriteOpers("*** User %s RecvQ of %d exceeds connect class maximum of %d",this->nick,recvq.length(),this->MyClass->GetRecvqMax()); @@ -567,7 +567,7 @@ void User::AddWriteBuf(const std::string &data) if (*this->GetWriteError()) return; - if (sendq.length() + data.length() > (unsigned)this->MyClass->GetSendqMax()) + if (this->MyClass && (sendq.length() + data.length() > this->MyClass->GetSendqMax())) { /* * Fix by brain - Set the error text BEFORE calling writeopers, because @@ -933,12 +933,12 @@ void User::FullConnect() /* Check the password, if one is required by the user's connect class. * This CANNOT be in CheckClass(), because that is called prior to PASS as well! */ - if ((!this->MyClass->GetPass().empty()) && (!this->haspassed)) + if (this->MyClass && !this->MyClass->GetPass().empty() && !this->haspassed) { User::QuitUser(ServerInstance, this, "Invalid password"); return; } - + if (!this->exempt) { GLine* r = ServerInstance->XLines->matches_gline(this); |