Codechange: encapsulate reading the size of a Packet

This commit is contained in:
Rubidium
2021-04-18 12:29:34 +02:00
committed by rubidium42
parent 6f161f6559
commit f71fb0f54a
5 changed files with 17 additions and 4 deletions

View File

@@ -137,7 +137,7 @@ void NetworkUDPSocketHandler::ReceivePackets()
/* If the size does not match the packet must be corrupted.
* Otherwise it will be marked as corrupted later on. */
if (!p.ParsePacketSize() || nbytes != p.size) {
if (!p.ParsePacketSize() || (size_t)nbytes != p.Size()) {
DEBUG(net, 1, "received a packet with mismatching size from %s", address.GetAddressAsString().c_str());
continue;
}