mirror of
https://github.com/FWGS/hlsdk-xash3d
synced 2024-11-23 18:29:36 +01:00
Additional bounds checks.
This commit is contained in:
parent
ff58521763
commit
a4f1f1a310
@ -1306,7 +1306,8 @@ int ReloadMapCycleFile( const char *filename, mapcycle_t *cycle )
|
||||
if( com_token[0] == '\0' )
|
||||
break;
|
||||
|
||||
strcpy( szMap, com_token );
|
||||
strncpy( szMap, com_token, sizeof( szMap ) - 1 );
|
||||
szMap[sizeof( szMap ) - 1] = '\0';
|
||||
|
||||
// Any more tokens on this line?
|
||||
if( COM_TokenWaiting( pFileList ) )
|
||||
@ -1316,7 +1317,8 @@ int ReloadMapCycleFile( const char *filename, mapcycle_t *cycle )
|
||||
if( com_token[0] != '\0' )
|
||||
{
|
||||
hasbuffer = 1;
|
||||
strcpy( szBuffer, com_token );
|
||||
strncpy( szBuffer, com_token, sizeof( szBuffer ) - 1 );
|
||||
szBuffer[sizeof( szBuffer ) - 1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user