avoid crashing when receiving a packet that is too large

This commit is contained in:
StapleButter 2017-12-19 01:00:55 +01:00
parent 5fe30d306f
commit 9336e15197
1 changed files with 2 additions and 0 deletions

View File

@ -410,6 +410,8 @@ void LAN_RXCallback(u_char* blarg, const struct pcap_pkthdr* header, const u_cha
{
while (PCapRXNum > 0);
if (header->len > 2048-64) return;
PCapPacketLen = header->len;
memcpy(PCapPacketBuffer, data, PCapPacketLen);
PCapRXNum = 1;