diff options
author | Lee Salzman <[email protected]> | 2024-11-14 00:50:03 -0500 |
---|---|---|
committer | Lee Salzman <[email protected]> | 2024-11-14 00:50:03 -0500 |
commit | 657eaf97d9d335917c58484a4a4b5e03838ebd8e (patch) | |
tree | c9d4d19aae59c4b2d0daa964242c9c9d0c5fbee4 /protocol.c | |
parent | 1e80a78f481cb2d2e4d9a0e2718b91995f2de51c (diff) | |
download | enet-657eaf97d9d335917c58484a4a4b5e03838ebd8e.tar.gz enet-657eaf97d9d335917c58484a4a4b5e03838ebd8e.zip |
Diffstat (limited to 'protocol.c')
-rw-r--r-- | protocol.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -665,7 +665,8 @@ enet_protocol_handle_send_unreliable_fragment (ENetHost * host, ENetPeer * peer, fragmentLength = ENET_NET_TO_HOST_16 (command -> sendFragment.dataLength); * currentData += fragmentLength; - if (fragmentLength > host -> maximumPacketSize || + if (fragmentLength <= 0 || + fragmentLength > host -> maximumPacketSize || * currentData < host -> receivedData || * currentData > & host -> receivedData [host -> receivedDataLength]) return -1; @@ -695,6 +696,7 @@ enet_protocol_handle_send_unreliable_fragment (ENetHost * host, ENetPeer * peer, if (fragmentCount > ENET_PROTOCOL_MAXIMUM_FRAGMENT_COUNT || fragmentNumber >= fragmentCount || totalLength > host -> maximumPacketSize || + totalLength < fragmentCount || fragmentOffset >= totalLength || fragmentLength > totalLength - fragmentOffset) return -1; |