mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:57:59 +02:00
Merge pull request #5671 from birarda/ice-server-crash
don't read ice-server packets that are too small
This commit is contained in:
commit
0ca9b60be5
1 changed files with 41 additions and 37 deletions
|
@ -55,6 +55,9 @@ void IceServer::processDatagrams() {
|
||||||
_serverSocket.readDatagram(buffer.get(), packetSizeWithHeader,
|
_serverSocket.readDatagram(buffer.get(), packetSizeWithHeader,
|
||||||
sendingSockAddr.getAddressPointer(), sendingSockAddr.getPortPointer());
|
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);
|
auto packet = Packet::fromReceivedPacket(std::move(buffer), packetSizeWithHeader, sendingSockAddr);
|
||||||
|
|
||||||
PacketType::Value packetType = packet->getType();
|
PacketType::Value packetType = packet->getType();
|
||||||
|
@ -98,6 +101,7 @@ void IceServer::processDatagrams() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedNetworkPeer IceServer::addOrUpdateHeartbeatingPeer(Packet& packet) {
|
SharedNetworkPeer IceServer::addOrUpdateHeartbeatingPeer(Packet& packet) {
|
||||||
|
|
Loading…
Reference in a new issue