1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 13:15:32 +00:00

Fixed security issue

This commit is contained in:
Stanislav Zhukov 2016-07-23 17:14:54 +08:00 committed by GitHub
parent fe50394f4d
commit 917fa63f5c

View file

@ -76,12 +76,15 @@ namespace mwmp
void RW(std::string &str, bool write)
{
if (write)
bs->Write(str.c_str());
{
RakNet::RakString rstr(str.c_str());
bs->Write(rstr);
}
else
{
char cstr[256];
bs->Read(cstr);
str = cstr;
RakNet::RakString rstr;
bs->Read(rstr);
str = rstr.C_String();
}
}