summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2011-01-27 16:13:17 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:56 +0000
commitcf7e16462de7f63e320e56bbd4f525c59f9fd930 (patch)
treef7f815057fdcaccd9f73d4d8198d8e7418e906aa
parentdc3114db78bda3b4485f47afbd99eeb61ca34d7c (diff)
* Add some buffer safety for BG_ParseCSV*List() functions (/dev/humancontroller)
-rw-r--r--src/game/bg_misc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index ae2f5c1d..d2d76b20 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -3613,7 +3613,7 @@ void BG_ParseCSVClassList( const char *string, class_t *classes, int classesSize
p = q = buffer;
- while( *p != '\0' )
+ while( *p != '\0' && i < classesSize - 1 )
{
//skip to first , or EOS
while( *p != ',' && *p != '\0' )
@@ -3663,7 +3663,7 @@ void BG_ParseCSVBuildableList( const char *string, buildable_t *buildables, int
p = q = buffer;
- while( *p != '\0' )
+ while( *p != '\0' && i < buildablesSize - 1 )
{
//skip to first , or EOS
while( *p != ',' && *p != '\0' )