From 917fa63f5c994dd6fd4539c06cbdd632d14a3fe3 Mon Sep 17 00:00:00 2001 From: Stanislav Zhukov Date: Sat, 23 Jul 2016 17:14:54 +0800 Subject: [PATCH] Fixed security issue --- components/openmw-mp/Packets/BasePacket.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/components/openmw-mp/Packets/BasePacket.hpp b/components/openmw-mp/Packets/BasePacket.hpp index 818b911e1..1cb10c855 100644 --- a/components/openmw-mp/Packets/BasePacket.hpp +++ b/components/openmw-mp/Packets/BasePacket.hpp @@ -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(); } }