diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp index 3f619dbe..7e26599c 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp @@ -425,11 +425,13 @@ template<> static void IRead(const uint8_t*& buf, plString& dest) { uint32_t size = *(reinterpret_cast(buf)); + uint32_t arraySize = size / 2; buf += sizeof(uint32_t); plStringBuffer str; - uint16_t* theStrBuffer = str.CreateWritableBuffer(size / sizeof(uint16_t)); + uint16_t* theStrBuffer = str.CreateWritableBuffer(arraySize - 1); memcpy(theStrBuffer, buf, size); + theStrBuffer[arraySize - 1] = 0; dest = plString::FromUtf16(str); buf += size; }