summaryrefslogtreecommitdiff
path: root/src/game/g_cmds.c
diff options
context:
space:
mode:
authorM. Kristall <mkpdev@gmail.com>2009-10-03 12:07:34 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:41 +0000
commitadca72d2a50b0a9695e1536dd8e6662070f20be1 (patch)
treee6a3c1fdfc21846d8f92211d3dbad409f79d1fa6 /src/game/g_cmds.c
parent49d828e1b9fb088130bee68b08675aaa1e3be8a6 (diff)
* Fix a buffer overflow introduced in revision 1121
* Admin parsing stuff: * Report the (theoretically) correct line number in parse error messages * Prevent an overflow in [command] section (levels) * Try to make the code flow a little better * !readconfig errors all get sent to console
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r--src/game/g_cmds.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 56617697..738239a7 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -3253,8 +3253,11 @@ qboolean G_SayArgv( int n, char *buffer, int bufferLength )
if( n > 0 )
return qfalse;
//memccpy( buffer, s, ' ', bufferLength );
- while( bufferLength > 1 && *s && *s != ' ' )
+ while( *s && *s != ' ' && bufferLength > 1 )
+ {
*buffer++ = *s++;
+ bufferLength--;
+ }
*buffer = 0;
return qtrue;
}