mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 01:53:45 +01:00
Prevent technically unsafe access with empty vector
This commit is contained in:
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
Block a user