From 9336e15197694eeb823da785668c5d892c318db4 Mon Sep 17 00:00:00 2001 From: StapleButter Date: Tue, 19 Dec 2017 01:00:55 +0100 Subject: avoid crashing when receiving a packet that is too large --- src/libui_sdl/Platform.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libui_sdl/Platform.cpp b/src/libui_sdl/Platform.cpp index f84f8f4..507e0f3 100644 --- a/src/libui_sdl/Platform.cpp +++ b/src/libui_sdl/Platform.cpp @@ -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; -- cgit v1.2.3