Fix bug in lower-casing API guarantee (r=fyren).

--HG--
extra : rebase_source : aa591e06a6dcf13b8964c893240ab56436a1efd3
This commit is contained in:
David Anderson 2012-04-13 16:50:44 -07:00
parent 4771398e1e
commit 1e57376cc7

View File

@ -664,6 +664,11 @@ cell_t ConsoleDetours::InternalDispatch(int client, const CCommand& args)
char name[255];
const char *realname = args.Arg(0);
size_t len = strlen(realname);
// Disallow command strings that are too long, for now.
if (len >= sizeof(name) - 1)
return Pl_Continue;
for (size_t i = 0; i < len; i++)
{
if (realname[i] >= 'A' && realname[i] <= 'Z')