diff options
author | StapleButter <thetotalworm@gmail.com> | 2017-12-19 01:00:55 +0100 |
---|---|---|
committer | StapleButter <thetotalworm@gmail.com> | 2017-12-19 01:00:55 +0100 |
commit | 9336e15197694eeb823da785668c5d892c318db4 (patch) | |
tree | fa8ca6dcdde743e1fe9ba8d584b897e3a0860a4b | |
parent | 5fe30d306fee644754f4f2f70142136ca6aa16a5 (diff) |
avoid crashing when receiving a packet that is too large
-rw-r--r-- | src/libui_sdl/Platform.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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; |