mirror of
https://github.com/minetest/minetest.git
synced 2024-11-30 11:33:44 +01:00
Fix access to invalid data on reception of packet with size 0
This commit is contained in:
parent
8948907431
commit
944e79d7a6
@ -2143,7 +2143,9 @@ void ConnectionReceiveThread::receive()
|
|||||||
LOG(derr_con<<m_connection->getDesc()
|
LOG(derr_con<<m_connection->getDesc()
|
||||||
<<"Receive(): Invalid incoming packet, "
|
<<"Receive(): Invalid incoming packet, "
|
||||||
<<"size: " << received_size
|
<<"size: " << received_size
|
||||||
<<", protocol: " << readU32(&packetdata[0]) <<std::endl);
|
<<", protocol: "
|
||||||
|
<< ((received_size >= 4) ? readU32(&packetdata[0]) : -1)
|
||||||
|
<< std::endl);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user