mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-27 03:30:50 +00:00
Improve previous PT_TEXTCMD/PT_TEXTCMD2 check, add another one to ignore zero size textcmds!
This commit is contained in:
parent
0b0b738a6f
commit
7147e0fcaf
1 changed files with 16 additions and 4 deletions
|
@ -3736,11 +3736,23 @@ FILESTAMP
|
||||||
tic_t tic = maketic;
|
tic_t tic = maketic;
|
||||||
UINT8 *textcmd;
|
UINT8 *textcmd;
|
||||||
|
|
||||||
// ignore if the textcmd size var is actually larger than it should be
|
// ignore if the textcmd has a reported size of zero
|
||||||
if (BASEPACKETSIZE + netbuffer->u.textcmd[0] > (size_t)doomcom->datalength)
|
// this shouldn't be sent at all
|
||||||
|
if (!netbuffer->u.textcmd[0])
|
||||||
{
|
{
|
||||||
DEBFILE(va("GetPacket: Bad Textcmd packet size! (expected %d, actual %d)\n",
|
DEBFILE(va("GetPacket: Textcmd with size 0 detected! (node %u, player %d)\n",
|
||||||
BASEPACKETSIZE + netbuffer->u.textcmd[0], doomcom->datalength));
|
node, netconsole));
|
||||||
|
Net_UnAcknowledgePacket(node);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ignore if the textcmd size var is actually larger than it should be
|
||||||
|
// BASEPACKETSIZE + 1 (for size) + textcmd[0] should == datalength
|
||||||
|
if (netbuffer->u.textcmd[0] > (size_t)doomcom->datalength-BASEPACKETSIZE-1)
|
||||||
|
{
|
||||||
|
DEBFILE(va("GetPacket: Bad Textcmd packet size! (expected %d, actual %d, node %u, player %d)\n",
|
||||||
|
netbuffer->u.textcmd[0], (size_t)doomcom->datalength-BASEPACKETSIZE-1,
|
||||||
|
node, netconsole));
|
||||||
Net_UnAcknowledgePacket(node);
|
Net_UnAcknowledgePacket(node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue