lpeer.c: pktSize sanity check

This commit is contained in:
CPunch 2022-01-27 20:10:41 -06:00
parent a023929190
commit 8627f5b85d
1 changed files with 4 additions and 0 deletions

View File

@ -45,6 +45,10 @@ bool laikaS_handlePeerIn(struct sLaika_peer *peer) {
LAIKA_ERROR("received evil pktID!\n")
peer->pktSize = peer->pktSizeTable[peer->pktID];
if (peer->pktSize == 0)
LAIKA_ERROR("unsupported packet!\n")
break;
case LAIKAPKT_VARPKT_REQ:
/* try grabbing pktID & size */