1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-27 17:28:41 +00:00

NetworkPacket: reading outside packet is now clearer.

Use a common function to check the reading offset
This commit is contained in:
Loic Blot 2015-04-01 14:47:43 +02:00
parent ddf96c7a17
commit 113bdd3ec0
2 changed files with 31 additions and 38 deletions

View file

@ -109,6 +109,8 @@ public:
// Temp, we remove SharedBuffer when migration finished
Buffer<u8> oldForgePacket();
private:
void checkReadOffset(u32 from_offset);
template<typename T> void checkDataSize()
{
if (m_read_offset + sizeof(T) > m_datasize) {