protocol: Fix problem with null characters in packet data

This commit is contained in:
Joshua Scott 2018-04-03 21:36:49 +01:00
parent 915b6e7e0a
commit c618e7d536
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ namespace protocol
static_assert(std::is_base_of<Serializable, DataT>::value, static_assert(std::is_base_of<Serializable, DataT>::value,
"DataT must derive from Serializable."); "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(); DataT *data = new DataT();
data->read_from(iss); data->read_from(iss);
return data; return data;