From 1a8bf792e7555463072b36a969350198a880d834 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Wed, 7 Jun 2017 20:38:12 -0500 Subject: [PATCH] Range check client number for trap_BotUserCommand --- code/server/sv_game.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/server/sv_game.c b/code/server/sv_game.c index 81f47933..161d975e 100644 --- a/code/server/sv_game.c +++ b/code/server/sv_game.c @@ -465,7 +465,13 @@ intptr_t SV_GameSystemCalls( intptr_t *args ) { case BOTLIB_GET_CONSOLE_MESSAGE: return SV_BotGetConsoleMessage( args[1], VMA(2), args[3] ); case BOTLIB_USER_COMMAND: - SV_ClientThink( &svs.clients[args[1]], VMA(2) ); + { + int clientNum = args[1]; + + if ( clientNum >= 0 && clientNum < sv_maxclients->integer ) { + SV_ClientThink( &svs.clients[clientNum], VMA(2) ); + } + } return 0; case BOTLIB_AAS_BBOX_AREAS: