From 1e57376cc736e1f77fac2cb7ef3f4d52f861e858 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). --HG-- extra : rebase_source : aa591e06a6dcf13b8964c893240ab56436a1efd3 --- core/ConsoleDetours.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/ConsoleDetours.cpp b/core/ConsoleDetours.cpp index a77bdca6b..854efc091 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')