[ioquake3] 120/136: Range check client number for trap_BotUserCommand

Simon McVittie smcv at debian.org
Thu Jun 15 09:09:17 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian/master
in repository ioquake3.

commit 1a8bf792e7555463072b36a969350198a880d834
Author: Zack Middleton <zack at cloemail.com>
Date:   Wed Jun 7 20:38:12 2017 -0500

    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 81f4793..161d975 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:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git



More information about the Pkg-games-commits mailing list