Fix possible levelPicNames buffer overflow in q3_ui

This commit is contained in:
Zack Middleton 2015-01-12 21:24:28 -06:00
parent daa604ae9b
commit af617bc0e6
1 changed files with 1 additions and 1 deletions

View File

@ -236,7 +236,7 @@ static void UI_SPLevelMenu_SetMenuArena( int n, int level, const char *arenaInfo
levelMenuInfo.levelScores[n] = 8; levelMenuInfo.levelScores[n] = 8;
} }
strcpy( levelMenuInfo.levelPicNames[n], va( "levelshots/%s.tga", map ) ); Com_sprintf( levelMenuInfo.levelPicNames[n], sizeof(levelMenuInfo.levelPicNames[n]), "levelshots/%s.tga", map );
if( !trap_R_RegisterShaderNoMip( levelMenuInfo.levelPicNames[n] ) ) { if( !trap_R_RegisterShaderNoMip( levelMenuInfo.levelPicNames[n] ) ) {
strcpy( levelMenuInfo.levelPicNames[n], ART_MAP_UNKNOWN ); strcpy( levelMenuInfo.levelPicNames[n], ART_MAP_UNKNOWN );
} }