From 7a124f2aa29d70749d34f95973364aaef06cb45c Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 13 Apr 2012 16:50:44 -0700 Subject: [PATCH] Fix bug in lower-casing API guarantee (r=fyren). --- core/ConsoleDetours.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/ConsoleDetours.cpp b/core/ConsoleDetours.cpp index a77bdca6..854efc09 100644 --- a/core/ConsoleDetours.cpp +++ b/core/ConsoleDetours.cpp @@ -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')