fix a buffer overrun in Steam_User_Stats::UpdateAvgRateStat

This commit is contained in:
otavepto 2024-05-23 00:47:34 +03:00
parent 36943fbfe6
commit 10f1e89736

View File

@ -533,7 +533,7 @@ Steam_User_Stats::InternalSetResult<std::pair<GameServerStats_Messages::StatInfo
double oldsessionlength = 0;
if (read_data == sizeof(data)) {
memcpy(&oldcount, data + sizeof(float), sizeof(oldcount));
memcpy(&oldsessionlength, data + sizeof(float) + sizeof(double), sizeof(oldsessionlength));
memcpy(&oldsessionlength, data + sizeof(float) + sizeof(float), sizeof(oldsessionlength));
}
oldcount += flCountThisSession;