diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp index 2f5deae2a..1ae47d190 100644 --- a/src/network/clientpackethandler.cpp +++ b/src/network/clientpackethandler.cpp @@ -900,7 +900,7 @@ void Client::handleCommand_DetachedInventory(NetworkPacket* pkt) u16 ignore; *pkt >> ignore; // this used to be the length of the following string, ignore it - std::string contents = pkt->getRemainingString(); + std::string contents(pkt->getRemainingString(), pkt->getRemainingBytes()); std::istringstream is(contents, std::ios::binary); inv->deSerialize(is); }