mirror of
https://github.com/lsalzman/enet
synced 2024-11-20 22:15:57 -07:00
fragment fixes
Some checks failed
CMake / CMake macos-latest Debug (push) Has been cancelled
CMake / CMake ubuntu-latest Debug (push) Has been cancelled
CMake / CMake windows-latest Debug (push) Has been cancelled
CMake / CMake macos-latest Release (push) Has been cancelled
CMake / CMake ubuntu-latest Release (push) Has been cancelled
CMake / CMake windows-latest Release (push) Has been cancelled
Some checks failed
CMake / CMake macos-latest Debug (push) Has been cancelled
CMake / CMake ubuntu-latest Debug (push) Has been cancelled
CMake / CMake windows-latest Debug (push) Has been cancelled
CMake / CMake macos-latest Release (push) Has been cancelled
CMake / CMake ubuntu-latest Release (push) Has been cancelled
CMake / CMake windows-latest Release (push) Has been cancelled
This commit is contained in:
parent
1e80a78f48
commit
657eaf97d9
1 changed files with 3 additions and 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;
|
||||
|
|
Loading…
Reference in a new issue