fix a few potential buffer overwrite in Game VM

This commit is contained in:
David CARLIER authored and Zack Middleton committed 2017-12-16 12:51:34 -06:00
1 parent 76ec9fb6bd
commit c904f6d4aa
2 files changed
+8 -8

No files matched your search

+4 -4
View File
@@ -838,11 +838,11 @@ void ClientUserinfoChanged( int clientNum ) {
teamLeader = client->sess.teamLeader;
// colors
strcpy(c1, Info_ValueForKey( userinfo, "color1" ));
strcpy(c2, Info_ValueForKey( userinfo, "color2" ));
Q_strncpyz(c1, Info_ValueForKey( userinfo, "color1" ), sizeof( c1 ));
Q_strncpyz(c2, Info_ValueForKey( userinfo, "color2" ), sizeof( c2 ));
strcpy(redTeam, Info_ValueForKey( userinfo, "g_redteam" ));
strcpy(blueTeam, Info_ValueForKey( userinfo, "g_blueteam" ));
Q_strncpyz(redTeam, Info_ValueForKey( userinfo, "g_redteam" ), sizeof( redTeam ));
Q_strncpyz(blueTeam, Info_ValueForKey( userinfo, "g_blueteam" ), sizeof( blueTeam ));
// send over a subset of the userinfo keys so other clients can
// print scoreboards, display models, and play custom sounds