From c618e7d53627aa9c1572f8ee4ec7cbc353eed400 Mon Sep 17 00:00:00 2001 From: Joshua Scott Date: Tue, 3 Apr 2018 21:36:49 +0100 Subject: [PATCH] protocol: Fix problem with null characters in packet data --- include/ki/protocol/Packet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ki/protocol/Packet.h b/include/ki/protocol/Packet.h index e877c8b..91eb7ab 100644 --- a/include/ki/protocol/Packet.h +++ b/include/ki/protocol/Packet.h @@ -39,7 +39,7 @@ namespace protocol static_assert(std::is_base_of::value, "DataT must derive from Serializable."); - std::istringstream iss(m_payload.data()); + std::istringstream iss(std::string(m_payload.data(), m_payload.size())); DataT *data = new DataT(); data->read_from(iss); return data;