Fixed security issue

pull/21/head^2
Stanislav Zhukov 9 years ago committed by GitHub
parent fe50394f4d
commit 917fa63f5c

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

Loading…
Cancel
Save