From b0546ed55e040330dd28a856d6fab2e55863dd1f Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 28 Dec 2008 22:18:49 +0000 Subject: 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 --- src/commands/cmd_stats.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/commands') diff --git a/src/commands/cmd_stats.cpp b/src/commands/cmd_stats.cpp index d362d4614..05c4ae0d2 100644 --- a/src/commands/cmd_stats.cpp +++ b/src/commands/cmd_stats.cpp @@ -39,7 +39,8 @@ CmdResult CommandStats::Handle (const std::vector& 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()); } -- cgit v1.2.3