diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2015-04-01 14:47:43 +0200 |
---|---|---|
committer | Loic Blot <loic.blot@unix-experience.fr> | 2015-04-01 14:47:46 +0200 |
commit | 113bdd3ec0608655d1ab36886b4708bb8ccb7870 (patch) | |
tree | 7f4a12e4ef0b92f0541c4986ea11291422628789 /src/network/networkpacket.h | |
parent | ddf96c7a17e45cdfb4a8060c3b0f74f17f7156df (diff) | |
download | minetest-113bdd3ec0608655d1ab36886b4708bb8ccb7870.tar.gz minetest-113bdd3ec0608655d1ab36886b4708bb8ccb7870.tar.bz2 minetest-113bdd3ec0608655d1ab36886b4708bb8ccb7870.zip |
NetworkPacket: reading outside packet is now clearer.
Use a common function to check the reading offset
Diffstat (limited to 'src/network/networkpacket.h')
-rw-r--r-- | src/network/networkpacket.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/network/networkpacket.h b/src/network/networkpacket.h index 0afb1e7e3..9ad169888 100644 --- a/src/network/networkpacket.h +++ b/src/network/networkpacket.h @@ -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) { |