diff --git a/engine/common/cfgscript.c b/engine/common/cfgscript.c index f426640f..56bd8006 100644 --- a/engine/common/cfgscript.c +++ b/engine/common/cfgscript.c @@ -54,7 +54,7 @@ Return true if next token is pExpext and skip it */ qboolean CSCR_ExpectString( parserstate_t *ps, const char *pExpect, qboolean skip, qboolean error ) { - char *tmp = COM_ParseFile( ps->buf, ps->token ); + char *tmp = COM_ParseFile( ps->buf, ps->token, sizeof( ps->token )); if( !Q_stricmp( ps->token, pExpect ) ) { @@ -99,13 +99,13 @@ CSCR_ParseSingleCvar qboolean CSCR_ParseSingleCvar( parserstate_t *ps, scrvardef_t *result ) { // read the name - ps->buf = COM_ParseFile( ps->buf, result->name ); + ps->buf = COM_ParseFile( ps->buf, result->name, sizeof( result->name )); if( !CSCR_ExpectString( ps, "{", false, true )) return false; // read description - ps->buf = COM_ParseFile( ps->buf, result->desc ); + ps->buf = COM_ParseFile( ps->buf, result->desc, sizeof( result->desc )); if( !CSCR_ExpectString( ps, "{", false, true )) return false; @@ -121,11 +121,11 @@ qboolean CSCR_ParseSingleCvar( parserstate_t *ps, scrvardef_t *result ) break; case T_NUMBER: // min - ps->buf = COM_ParseFile( ps->buf, ps->token ); + ps->buf = COM_ParseFile( ps->buf, ps->token, sizeof( ps->token )); result->fMin = Q_atof( ps->token ); // max - ps->buf = COM_ParseFile( ps->buf, ps->token ); + ps->buf = COM_ParseFile( ps->buf, ps->token, sizeof( ps->token )); result->fMax = Q_atof( ps->token ); if( !CSCR_ExpectString( ps, "}", false, true )) @@ -149,7 +149,7 @@ qboolean CSCR_ParseSingleCvar( parserstate_t *ps, scrvardef_t *result ) return false; // default value - ps->buf = COM_ParseFile( ps->buf, result->value ); + ps->buf = COM_ParseFile( ps->buf, result->value, sizeof( result->value )); if( !CSCR_ExpectString( ps, "}", false, true )) return false; @@ -177,7 +177,7 @@ qboolean CSCR_ParseHeader( parserstate_t *ps ) // Parse in the version # // Get the first token. - ps->buf = COM_ParseFile( ps->buf, ps->token ); + ps->buf = COM_ParseFile( ps->buf, ps->token, sizeof( ps->token )); if( Q_atof( ps->token ) != 1 ) { @@ -188,7 +188,7 @@ qboolean CSCR_ParseHeader( parserstate_t *ps ) if( !CSCR_ExpectString( ps, "DESCRIPTION", false, true )) return false; - ps->buf = COM_ParseFile( ps->buf, ps->token ); + ps->buf = COM_ParseFile( ps->buf, ps->token, sizeof( ps->token )); if( Q_stricmp( ps->token, "INFO_OPTIONS") && Q_stricmp( ps->token, "SERVER_OPTIONS" )) { @@ -247,7 +247,7 @@ static int CSCR_ParseFile( const char *scriptfilename, break; } - if( COM_ParseFile( state.buf, state.token )) + if( COM_ParseFile( state.buf, state.token, sizeof( state.token ))) Con_DPrintf( S_ERROR "Got extra tokens!\n" ); else success = true; finish: diff --git a/engine/common/con_utils.c b/engine/common/con_utils.c index 55b9676d..c6b2cd3c 100644 --- a/engine/common/con_utils.c +++ b/engine/common/con_utils.c @@ -120,24 +120,24 @@ int Cmd_ListMaps( search_t *t, char *lastmapname, size_t len ) message[0] = 0; // remove 'error' pfile = ents; - while(( pfile = COM_ParseFile( pfile, token )) != NULL ) + while(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) != NULL ) { if( !Q_strcmp( token, "{" )) continue; else if( !Q_strcmp( token, "}" )) break; else if( !Q_strcmp( token, "message" )) { // get the message contents - pfile = COM_ParseFile( pfile, message ); + pfile = COM_ParseFile( pfile, message, sizeof( message )); } else if( !Q_strcmp( token, "compiler" ) || !Q_strcmp( token, "_compiler" )) { // get the message contents - pfile = COM_ParseFile( pfile, compiler ); + pfile = COM_ParseFile( pfile, compiler, sizeof( compiler )); } else if( !Q_strcmp( token, "generator" ) || !Q_strcmp( token, "_generator" )) { // get the message contents - pfile = COM_ParseFile( pfile, generator ); + pfile = COM_ParseFile( pfile, generator, sizeof( generator )); } } Mem_Free( ents ); @@ -942,18 +942,18 @@ qboolean Cmd_CheckMapsList_R( qboolean fRefresh, qboolean onlyingamedir ) Q_strncpy( message, "No Title", MAX_STRING ); pfile = ents; - while(( pfile = COM_ParseFile( pfile, token )) != NULL ) + while(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) != NULL ) { if( token[0] == '}' && worldspawn ) worldspawn = false; else if( !Q_strcmp( token, "message" ) && worldspawn ) { // get the message contents - pfile = COM_ParseFile( pfile, message ); + pfile = COM_ParseFile( pfile, message, sizeof( message )); } else if( !Q_strcmp( token, "classname" )) { - pfile = COM_ParseFile( pfile, token ); + pfile = COM_ParseFile( pfile, token, sizeof( token )); if( !Q_strcmp( token, GI->mp_entity ) || use_filter ) num_spawnpoints++; } diff --git a/engine/common/filesystem.c b/engine/common/filesystem.c index 72efd475..3b8ac690 100644 --- a/engine/common/filesystem.c +++ b/engine/common/filesystem.c @@ -1597,69 +1597,69 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool qboolean found_linux = false, found_osx = false; string token; - while(( pfile = COM_ParseFile( pfile, token )) != NULL ) + while(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) != NULL ) { // different names in liblist/gameinfo if( !Q_stricmp( token, isGameInfo ? "title" : "game" )) { - pfile = COM_ParseFile( pfile, GameInfo->title ); + pfile = COM_ParseFile( pfile, GameInfo->title, sizeof( GameInfo->title )); } // valid for both else if( !Q_stricmp( token, "fallback_dir" )) { - pfile = COM_ParseFile( pfile, GameInfo->falldir ); + pfile = COM_ParseFile( pfile, GameInfo->falldir, sizeof( GameInfo->falldir )); } // valid for both else if( !Q_stricmp( token, "startmap" )) { - pfile = COM_ParseFile( pfile, GameInfo->startmap ); + pfile = COM_ParseFile( pfile, GameInfo->startmap, sizeof( GameInfo->startmap )); COM_StripExtension( GameInfo->startmap ); // HQ2:Amen has extension .bsp } // only trainmap is valid for gameinfo else if( !Q_stricmp( token, "trainmap" ) || (!isGameInfo && !Q_stricmp( token, "trainingmap" ))) { - pfile = COM_ParseFile( pfile, GameInfo->trainmap ); + pfile = COM_ParseFile( pfile, GameInfo->trainmap, sizeof( GameInfo->trainmap )); COM_StripExtension( GameInfo->trainmap ); // HQ2:Amen has extension .bsp } // valid for both else if( !Q_stricmp( token, "url_info" )) { - pfile = COM_ParseFile( pfile, GameInfo->game_url ); + pfile = COM_ParseFile( pfile, GameInfo->game_url, sizeof( GameInfo->game_url )); } // different names else if( !Q_stricmp( token, isGameInfo ? "url_update" : "url_dl" )) { - pfile = COM_ParseFile( pfile, GameInfo->update_url ); + pfile = COM_ParseFile( pfile, GameInfo->update_url, sizeof( GameInfo->update_url )); } // valid for both else if( !Q_stricmp( token, "gamedll" )) { - pfile = COM_ParseFile( pfile, GameInfo->game_dll ); + pfile = COM_ParseFile( pfile, GameInfo->game_dll, sizeof( GameInfo->game_dll )); COM_FixSlashes( GameInfo->game_dll ); } // valid for both else if( !Q_stricmp( token, "gamedll_linux" )) { - pfile = COM_ParseFile( pfile, GameInfo->game_dll_linux ); + pfile = COM_ParseFile( pfile, GameInfo->game_dll_linux, sizeof( GameInfo->game_dll_linux )); found_linux = true; } // valid for both else if( !Q_stricmp( token, "gamedll_osx" )) { - pfile = COM_ParseFile( pfile, GameInfo->game_dll_osx ); + pfile = COM_ParseFile( pfile, GameInfo->game_dll_osx, sizeof( GameInfo->game_dll_osx )); found_osx = true; } // valid for both else if( !Q_stricmp( token, "icon" )) { - pfile = COM_ParseFile( pfile, GameInfo->iconpath ); + pfile = COM_ParseFile( pfile, GameInfo->iconpath, sizeof( GameInfo->iconpath )); COM_FixSlashes( GameInfo->iconpath ); COM_DefaultExtension( GameInfo->iconpath, ".ico" ); } else if( !Q_stricmp( token, "type" )) { - pfile = COM_ParseFile( pfile, token ); + pfile = COM_ParseFile( pfile, token, sizeof( token )); if( !isGameInfo && !Q_stricmp( token, "singleplayer_only" )) { @@ -1689,43 +1689,43 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool // valid for both else if( !Q_stricmp( token, "version" )) { - pfile = COM_ParseFile( pfile, token ); + pfile = COM_ParseFile( pfile, token, sizeof( token )); GameInfo->version = Q_atof( token ); } // valid for both else if( !Q_stricmp( token, "size" )) { - pfile = COM_ParseFile( pfile, token ); + pfile = COM_ParseFile( pfile, token, sizeof( token )); GameInfo->size = Q_atoi( token ); } else if( !Q_stricmp( token, "edicts" )) { - pfile = COM_ParseFile( pfile, token ); + pfile = COM_ParseFile( pfile, token, sizeof( token )); GameInfo->max_edicts = Q_atoi( token ); } else if( !Q_stricmp( token, isGameInfo ? "mp_entity" : "mpentity" )) { - pfile = COM_ParseFile( pfile, GameInfo->mp_entity ); + pfile = COM_ParseFile( pfile, GameInfo->mp_entity, sizeof( GameInfo->mp_entity )); } else if( !Q_stricmp( token, isGameInfo ? "mp_filter" : "mpfilter" )) { - pfile = COM_ParseFile( pfile, GameInfo->mp_filter ); + pfile = COM_ParseFile( pfile, GameInfo->mp_filter, sizeof( GameInfo->mp_filter )); } // valid for both else if( !Q_stricmp( token, "secure" )) { - pfile = COM_ParseFile( pfile, token ); + pfile = COM_ParseFile( pfile, token, sizeof( token )); GameInfo->secure = Q_atoi( token ); } // valid for both else if( !Q_stricmp( token, "nomodels" )) { - pfile = COM_ParseFile( pfile, token ); + pfile = COM_ParseFile( pfile, token, sizeof( token )); GameInfo->nomodels = Q_atoi( token ); } else if( !Q_stricmp( token, isGameInfo ? "max_edicts" : "edicts" )) { - pfile = COM_ParseFile( pfile, token ); + pfile = COM_ParseFile( pfile, token, sizeof( token )); GameInfo->max_edicts = bound( MIN_EDICTS, Q_atoi( token ), MAX_EDICTS ); } // only for gameinfo @@ -1734,40 +1734,40 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool if( !Q_stricmp( token, "basedir" )) { string fs_path; - pfile = COM_ParseFile( pfile, fs_path ); + pfile = COM_ParseFile( pfile, fs_path, sizeof( fs_path )); if( Q_stricmp( fs_path, GameInfo->basedir ) || Q_stricmp( fs_path, GameInfo->gamefolder )) Q_strncpy( GameInfo->basedir, fs_path, sizeof( GameInfo->basedir )); } else if( !Q_stricmp( token, "sp_entity" )) { - pfile = COM_ParseFile( pfile, GameInfo->sp_entity ); + pfile = COM_ParseFile( pfile, GameInfo->sp_entity, sizeof( GameInfo->sp_entity )); } else if( isGameInfo && !Q_stricmp( token, "dllpath" )) { - pfile = COM_ParseFile( pfile, GameInfo->dll_path ); + pfile = COM_ParseFile( pfile, GameInfo->dll_path, sizeof( GameInfo->dll_path )); } else if( isGameInfo && !Q_stricmp( token, "date" )) { - pfile = COM_ParseFile( pfile, GameInfo->date ); + pfile = COM_ParseFile( pfile, GameInfo->date, sizeof( GameInfo->date )); } else if( !Q_stricmp( token, "max_tempents" )) { - pfile = COM_ParseFile( pfile, token ); + pfile = COM_ParseFile( pfile, token, sizeof( token )); GameInfo->max_tents = bound( 300, Q_atoi( token ), 2048 ); } else if( !Q_stricmp( token, "max_beams" )) { - pfile = COM_ParseFile( pfile, token ); + pfile = COM_ParseFile( pfile, token, sizeof( token )); GameInfo->max_beams = bound( 64, Q_atoi( token ), 512 ); } else if( !Q_stricmp( token, "max_particles" )) { - pfile = COM_ParseFile( pfile, token ); + pfile = COM_ParseFile( pfile, token, sizeof( token )); GameInfo->max_particles = bound( 4096, Q_atoi( token ), 32768 ); } else if( !Q_stricmp( token, "gamemode" )) { - pfile = COM_ParseFile( pfile, token ); + pfile = COM_ParseFile( pfile, token, sizeof( token )); // TODO: Remove this ugly hack too. // This was made because Half-Life has multiplayer, // but for some reason it's marked as singleplayer_only. @@ -1783,11 +1783,12 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool if( ambientNum < 0 || ambientNum > ( NUM_AMBIENTS - 1 )) ambientNum = 0; - pfile = COM_ParseFile( pfile, GameInfo->ambientsound[ambientNum] ); + pfile = COM_ParseFile( pfile, GameInfo->ambientsound[ambientNum], + sizeof( GameInfo->ambientsound[ambientNum] )); } else if( !Q_stricmp( token, "noskills" )) { - pfile = COM_ParseFile( pfile, token ); + pfile = COM_ParseFile( pfile, token, sizeof( token )); GameInfo->noskills = Q_atoi( token ); } } diff --git a/engine/common/identification.c b/engine/common/identification.c index dc9857f3..872f38e1 100644 --- a/engine/common/identification.c +++ b/engine/common/identification.c @@ -445,8 +445,8 @@ int ID_ProcessWMIC( bloomfilter_t *value, const char *cmdline ) if( !ID_RunWMIC( buffer, cmdline ) ) return 0; - pbuf = COM_ParseFile( buffer, token ); // Header - while( pbuf = COM_ParseFile( pbuf, token ) ) + pbuf = COM_ParseFile( buffer, token, sizeof( token )); // Header + while( pbuf = COM_ParseFile( pbuf, token, sizeof( token ) ) ) { if( !ID_VerifyHEX( token ) ) continue; @@ -465,8 +465,8 @@ int ID_CheckWMIC( bloomfilter_t value, const char *cmdline ) if( !ID_RunWMIC( buffer, cmdline ) ) return 0; - pbuf = COM_ParseFile( buffer, token ); // Header - while( pbuf = COM_ParseFile( pbuf, token ) ) + pbuf = COM_ParseFile( buffer, token, sizeof( token )); // Header + while( pbuf = COM_ParseFile( pbuf, token, sizeof( token ) ) ) { bloomfilter_t filter; diff --git a/engine/common/masterlist.c b/engine/common/masterlist.c index b3a1acd3..4dbd325b 100644 --- a/engine/common/masterlist.c +++ b/engine/common/masterlist.c @@ -189,11 +189,11 @@ static void NET_LoadMasters( void ) pfile = (char*)afile; // format: master \n - while( ( pfile = COM_ParseFile( pfile, token ) ) ) + while( ( pfile = COM_ParseFile( pfile, token, sizeof( token ) ) ) ) { if( !Q_strcmp( token, "master" ) ) // load addr { - pfile = COM_ParseFile( pfile, token ); + pfile = COM_ParseFile( pfile, token, sizeof( token ) ); NET_AddMaster( token, true ); } diff --git a/engine/common/mod_bmodel.c b/engine/common/mod_bmodel.c index da8443ad..eda98786 100644 --- a/engine/common/mod_bmodel.c +++ b/engine/common/mod_bmodel.c @@ -785,7 +785,7 @@ static void Mod_FindModelOrigin( const char *entities, const char *modelname, ve pfile = (char *)entities; - while(( pfile = COM_ParseFile( pfile, token )) != NULL ) + while(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) != NULL ) { if( token[0] != '{' ) Host_Error( "Mod_FindModelOrigin: found %s when expecting {\n", token ); @@ -796,14 +796,14 @@ static void Mod_FindModelOrigin( const char *entities, const char *modelname, ve while( 1 ) { // parse key - if(( pfile = COM_ParseFile( pfile, token )) == NULL ) + if(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) == NULL ) Host_Error( "Mod_FindModelOrigin: EOF without closing brace\n" ); if( token[0] == '}' ) break; // end of desc Q_strncpy( keyname, token, sizeof( keyname )); // parse value - if(( pfile = COM_ParseFile( pfile, token )) == NULL ) + if(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) == NULL ) Host_Error( "Mod_FindModelOrigin: EOF without closing brace\n" ); if( token[0] == '}' ) @@ -1679,7 +1679,7 @@ static void Mod_LoadEntities( dbspmodel_t *bmod ) bmod->wadlist.count = 0; // parse all the wads for loading textures in right ordering - while(( pfile = COM_ParseFile( pfile, token )) != NULL ) + while(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) != NULL ) { if( token[0] != '{' ) Host_Error( "Mod_LoadEntities: found %s when expecting {\n", token ); @@ -1687,14 +1687,14 @@ static void Mod_LoadEntities( dbspmodel_t *bmod ) while( 1 ) { // parse key - if(( pfile = COM_ParseFile( pfile, token )) == NULL ) + if(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) == NULL ) Host_Error( "Mod_LoadEntities: EOF without closing brace\n" ); if( token[0] == '}' ) break; // end of desc Q_strncpy( keyname, token, sizeof( keyname )); // parse value - if(( pfile = COM_ParseFile( pfile, token )) == NULL ) + if(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) == NULL ) Host_Error( "Mod_LoadEntities: EOF without closing brace\n" ); if( token[0] == '}' ) diff --git a/engine/common/net_encode.c b/engine/common/net_encode.c index ea4c6bad..3c4c8c37 100644 --- a/engine/common/net_encode.c +++ b/engine/common/net_encode.c @@ -561,7 +561,7 @@ qboolean Delta_ParseField( char **delta_script, const delta_field_t *pInfo, delt delta_field_t *pFieldInfo; char *oldpos; - *delta_script = COM_ParseFile( *delta_script, token ); + *delta_script = COM_ParseFile( *delta_script, token, sizeof( token )); if( Q_strcmp( token, "(" )) { Con_DPrintf( S_ERROR "Delta_ParseField: expected '(', found '%s' instead\n", token ); @@ -569,7 +569,7 @@ qboolean Delta_ParseField( char **delta_script, const delta_field_t *pInfo, delt } // read the variable name - if(( *delta_script = COM_ParseFile( *delta_script, token )) == NULL ) + if(( *delta_script = COM_ParseFile( *delta_script, token, sizeof( token ))) == NULL ) { Con_DPrintf( S_ERROR "Delta_ParseField: missing field name\n" ); return false; @@ -582,7 +582,7 @@ qboolean Delta_ParseField( char **delta_script, const delta_field_t *pInfo, delt return false; } - *delta_script = COM_ParseFile( *delta_script, token ); + *delta_script = COM_ParseFile( *delta_script, token, sizeof( token )); if( Q_strcmp( token, "," )) { Con_DPrintf( S_ERROR "Delta_ParseField: expected ',', found '%s' instead\n", token ); @@ -596,7 +596,7 @@ qboolean Delta_ParseField( char **delta_script, const delta_field_t *pInfo, delt pField->flags = 0; // read delta-flags - while(( *delta_script = COM_ParseFile( *delta_script, token )) != NULL ) + while(( *delta_script = COM_ParseFile( *delta_script, token, sizeof( token ))) != NULL ) { if( !Q_strcmp( token, "," )) break; // end of flags argument @@ -631,7 +631,7 @@ qboolean Delta_ParseField( char **delta_script, const delta_field_t *pInfo, delt } // read delta-bits - if(( *delta_script = COM_ParseFile( *delta_script, token )) == NULL ) + if(( *delta_script = COM_ParseFile( *delta_script, token, sizeof( token ))) == NULL ) { Con_DPrintf( S_ERROR "Delta_ReadField: %s field bits argument is missing\n", pField->name ); return false; @@ -639,7 +639,7 @@ qboolean Delta_ParseField( char **delta_script, const delta_field_t *pInfo, delt pField->bits = Q_atoi( token ); - *delta_script = COM_ParseFile( *delta_script, token ); + *delta_script = COM_ParseFile( *delta_script, token, sizeof( token )); if( Q_strcmp( token, "," )) { Con_DPrintf( S_ERROR "Delta_ReadField: expected ',', found '%s' instead\n", token ); @@ -647,7 +647,7 @@ qboolean Delta_ParseField( char **delta_script, const delta_field_t *pInfo, delt } // read delta-multiplier - if(( *delta_script = COM_ParseFile( *delta_script, token )) == NULL ) + if(( *delta_script = COM_ParseFile( *delta_script, token, sizeof( token ))) == NULL ) { Con_DPrintf( S_ERROR "Delta_ReadField: %s missing 'multiplier' argument\n", pField->name ); return false; @@ -657,7 +657,7 @@ qboolean Delta_ParseField( char **delta_script, const delta_field_t *pInfo, delt if( bPost ) { - *delta_script = COM_ParseFile( *delta_script, token ); + *delta_script = COM_ParseFile( *delta_script, token, sizeof( token )); if( Q_strcmp( token, "," )) { Con_DPrintf( S_ERROR "Delta_ReadField: expected ',', found '%s' instead\n", token ); @@ -665,7 +665,7 @@ qboolean Delta_ParseField( char **delta_script, const delta_field_t *pInfo, delt } // read delta-postmultiplier - if(( *delta_script = COM_ParseFile( *delta_script, token )) == NULL ) + if(( *delta_script = COM_ParseFile( *delta_script, token, sizeof( token ))) == NULL ) { Con_DPrintf( S_ERROR "Delta_ReadField: %s missing 'post_multiply' argument\n", pField->name ); return false; @@ -680,7 +680,7 @@ qboolean Delta_ParseField( char **delta_script, const delta_field_t *pInfo, delt } // closing brace... - *delta_script = COM_ParseFile( *delta_script, token ); + *delta_script = COM_ParseFile( *delta_script, token, sizeof( token )); if( Q_strcmp( token, ")" )) { Con_DPrintf( S_ERROR "Delta_ParseField: expected ')', found '%s' instead\n", token ); @@ -689,7 +689,7 @@ qboolean Delta_ParseField( char **delta_script, const delta_field_t *pInfo, delt // ... and trying to parse optional ',' post-symbol oldpos = *delta_script; - *delta_script = COM_ParseFile( *delta_script, token ); + *delta_script = COM_ParseFile( *delta_script, token, sizeof( token )); if( token[0] != ',' ) *delta_script = oldpos; // not a ',' return true; @@ -709,7 +709,7 @@ void Delta_ParseTable( char **delta_script, delta_info_t *dt, const char *encode dt->numFields = 0; // assume we have handled '{' - while(( *delta_script = COM_ParseFile( *delta_script, token )) != NULL ) + while(( *delta_script = COM_ParseFile( *delta_script, token, sizeof( token ))) != NULL ) { Assert( dt->numFields <= dt->maxFields ); @@ -761,7 +761,7 @@ void Delta_InitFields( void ) pfile = (char *)afile; - while(( pfile = COM_ParseFile( pfile, token )) != NULL ) + while(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) != NULL ) { dt = Delta_FindStruct( token ); @@ -770,14 +770,14 @@ void Delta_InitFields( void ) Sys_Error( "%s: unknown struct %s\n", DELTA_PATH, token ); } - pfile = COM_ParseFile( pfile, encodeDll ); + pfile = COM_ParseFile( pfile, encodeDll, sizeof( encodeDll )); if( !Q_stricmp( encodeDll, "none" )) Q_strcpy( encodeFunc, "null" ); - else pfile = COM_ParseFile( pfile, encodeFunc ); + else pfile = COM_ParseFile( pfile, encodeFunc, sizeof( encodeFunc )); // jump to '{' - pfile = COM_ParseFile( pfile, token ); + pfile = COM_ParseFile( pfile, token, sizeof( token )); if( token[0] != '{' ) { diff --git a/engine/common/net_ws.c b/engine/common/net_ws.c index edf0095a..896ff442 100644 --- a/engine/common/net_ws.c +++ b/engine/common/net_ws.c @@ -2559,7 +2559,7 @@ void HTTP_Init( void ) if( serverfile ) { - while( ( line = COM_ParseFile( line, token ) ) ) + while( ( line = COM_ParseFile( line, token, sizeof( token ) ) ) ) { httpserver_t *server = HTTP_ParseURL( token );