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:
parent
ddf96c7a17
commit
113bdd3ec0
2 changed files with 31 additions and 38 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue