Fix for bug #134 reported by mixx941: When user connects to ircd with no usermodes set on themselves, an m_spanningtree std::string throws a range exception because we try and substr npos.

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5091 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
brain 2006-08-31 21:47:57 +00:00
parent 134e29c6b7
commit 008850b6f3

View File

@ -1694,7 +1694,9 @@ class TreeSocket : public InspSocket
/* This used to have a pretty craq'y loop doing the same thing,
* now we just let the STL do the hard work (more efficiently)
*/
params[5] = params[5].substr(params[5].find_first_not_of('+'));
std::string::size_type pos_after_plus = params[5].find_first_not_of('+');
if (pos_after_plus != std::string::npos)
params[5] = params[5].substr(pos_after_plus);
const char* tempnick = params[1].c_str();
ServerInstance->Log(DEBUG,"Introduce client %s!%s@%s",tempnick,params[4].c_str(),params[2].c_str());