Fix critical buffer overflow in cgame, see exploit at http://www.milw0rm.com/exploits/1977

This commit is contained in:
Thilo Schulz 2006-07-06 00:37:56 +00:00
parent a24ffc0dd5
commit fc244c97ef

View file

@ -703,7 +703,7 @@ static void CG_RegisterSounds( void ) {
}
// only register the items that the server says we need
strcpy( items, CG_ConfigString( CS_ITEMS ) );
Q_strncpyz(items, CG_ConfigString(CS_ITEMS), sizeof(items));
for ( i = 1 ; i < bg_numItems ; i++ ) {
// if ( items[ i ] == '1' || cg_buildScript.integer ) {
@ -1016,7 +1016,7 @@ static void CG_RegisterGraphics( void ) {
memset( cg_weapons, 0, sizeof( cg_weapons ) );
// only register the items that the server says we need
strcpy( items, CG_ConfigString( CS_ITEMS) );
Q_strncpyz(items, CG_ConfigString(CS_ITEMS), sizeof(items));
for ( i = 1 ; i < bg_numItems ; i++ ) {
if ( items[ i ] == '1' || cg_buildScript.integer ) {