Account for the size of packet length and ID in validation functions.

This commit is contained in:
2020-09-08 03:01:47 +02:00
parent e90ae10746
commit 45a33758a5
3 changed files with 5 additions and 5 deletions

View File

@@ -91,7 +91,7 @@ void CombatManager::giveReward(CNSocket *sock) {
Player *plr = PlayerManager::getPlayer(sock);
const size_t resplen = sizeof(sP_FE2CL_REP_REWARD_ITEM) + sizeof(sItemReward);
assert(resplen < CN_PACKET_BUFFER_SIZE);
assert(resplen < CN_PACKET_BUFFER_SIZE - 8);
// we know it's only one trailing struct, so we can skip full validation
uint8_t respbuf[resplen]; // not a variable length array, don't worry