Browse Source

Fix SVC_VOICEINIT vuln

master
shelru 8 years ago committed by GitHub
parent
commit
af1694b5b0
  1. 14
      MiniBase/enginemsg.cpp

14
MiniBase/enginemsg.cpp

@ -208,16 +208,16 @@ void SVC_Director(){
void SVC_VoiceInit() { void SVC_VoiceInit() {
MSG_SaveReadCount(); MSG_SaveReadCount();
char* codec = MSG_ReadString(); int bitz = MSG_ReadByte(); char* codec = MSG_ReadString(); int bitz = MSG_ReadByte();
char str[1024], bit[15]; sprintf(bit, "%d", bitz); // char bit[15]; sprintf(bit, "%d", bitz);
strncpy(str, codec, sizeof(str)); /* ConsolePrintColor(255, 255, 255, "[Extra Mirror] voiceinit: Codec = ");
str[sizeof(str) - 1] = 0; ConsolePrintColor(255, 255, 255, ("%s", codec));
ConsolePrintColor(255, 255, 255, "[Extra Mirror] voiceinit: "); ConsolePrintColor(255, 255, 255, " bit = ");
ConsolePrintColor(255, 255, 255, (" %s - ", str));
ConsolePrintColor(255, 255, 255, (" %s - ", codec));
ConsolePrintColor(255, 255, 255, (" %s", bit)); ConsolePrintColor(255, 255, 255, (" %s", bit));
ConsolePrintColor(255, 255, 255, "\n"); ConsolePrintColor(255, 255, 255, "\n");*/
if(!stricmp(codec,"voice_miles")||!stricmp(codec,"voice_speex")){
MSG_RestoreReadCount(); MSG_RestoreReadCount();
pSVC_VoiceInit(); pSVC_VoiceInit();
}
} }
/* /*
void SVC_Resourcelist() { void SVC_Resourcelist() {

Loading…
Cancel
Save