mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Fix bug spotted by KingTarquin, if an empty string is given to /stats with "STATS :", then a byte of undefined memory in a std::string object is read as the stats char. Probably unsafe.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10927 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
376a2833d9
commit
b0546ed55e
@ -39,7 +39,8 @@ CmdResult CommandStats::Handle (const std::vector<std::string>& parameters, User
|
||||
if (IS_LOCAL(user))
|
||||
{
|
||||
string_list values;
|
||||
DoStats(this->ServerInstance, parameters[0][0], user, values);
|
||||
char search = parameters[0].length() ? parameters[0][0] : 0;
|
||||
DoStats(this->ServerInstance, search, user, values);
|
||||
for (size_t i = 0; i < values.size(); i++)
|
||||
user->Write(":%s", values[i].c_str());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user