mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
don't read packets that are too small
This commit is contained in:
parent
d0db56a4a6
commit
b4e624a64d
1 changed files with 41 additions and 37 deletions
|
@ -55,6 +55,9 @@ void IceServer::processDatagrams() {
|
|||
_serverSocket.readDatagram(buffer.get(), packetSizeWithHeader,
|
||||
sendingSockAddr.getAddressPointer(), sendingSockAddr.getPortPointer());
|
||||
|
||||
// make sure that this packet at least looks like something we can read
|
||||
if (packetSizeWithHeader >= Packet::localHeaderSize(PacketType::ICEServerHeartbeat)) {
|
||||
|
||||
auto packet = Packet::fromReceivedPacket(std::move(buffer), packetSizeWithHeader, sendingSockAddr);
|
||||
|
||||
PacketType::Value packetType = packet->getType();
|
||||
|
@ -98,6 +101,7 @@ void IceServer::processDatagrams() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SharedNetworkPeer IceServer::addOrUpdateHeartbeatingPeer(Packet& packet) {
|
||||
|
|
Loading…
Reference in a new issue