1
0
mirror of https://github.com/CPunch/Laika.git synced 2025-09-27 04:10:08 +00:00

Lib: Variadic packets now use the 'size' field as a minimum requirement

This commit is contained in:
2022-06-30 10:00:11 -05:00
parent bc071c10d2
commit 18a6fdd124
6 changed files with 11 additions and 7 deletions

View File

@@ -244,6 +244,10 @@ bool laikaS_handlePeerIn(struct sLaika_socket *sock)
!peer->packetTbl[peer->pktID].variadic)
LAIKA_ERROR("requested packet id [%d] is not variadic!\n", peer->pktID);
/* sanity check minimum size */
if (peer->pktSize <= peer->packetTbl[peer->pktID].size)
LAIKA_ERROR("requested variable packet is too small!\n");
/* if peer->useSecure is true, body is encrypted */
laikaS_startInPacket(peer, true);
goto _HandlePacketBody;