Prevent technically unsafe access with empty vector
parent
a7c50a3080
commit
87dcee6ac2
|
@ -77,6 +77,9 @@ void NetworkPacket::putRawString(const char* src, u32 len)
|
|||
m_data.resize(m_datasize);
|
||||
}
|
||||
|
||||
if (m_datasize == 0)
|
||||
return;
|
||||
|
||||
memcpy(&m_data[m_read_offset], src, len);
|
||||
m_read_offset += len;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue