From 0b23fa61d4d93c10c591a2abf7d3319aa264b078 Mon Sep 17 00:00:00 2001 From: Patrick Fink Date: Sat, 16 Jan 2021 16:51:10 +0100 Subject: [PATCH 1/2] Fix UDP buffer overflow Co-Authored-By: Christoph Schulz --- libraries/Bridge/src/BridgeUdp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Bridge/src/BridgeUdp.h b/libraries/Bridge/src/BridgeUdp.h index 090768cb..f518eb6b 100644 --- a/libraries/Bridge/src/BridgeUdp.h +++ b/libraries/Bridge/src/BridgeUdp.h @@ -11,7 +11,7 @@ class BridgeUDP : public UDP { IPAddress multicast_ip; IPAddress remote_ip; uint16_t remote_port; - char buffer[1460]; + char buffer[1500]; size_t buffer_len; cbuf * rx_buffer; public: From b918d58d45852818842997e4232a5114fe47e9c4 Mon Sep 17 00:00:00 2001 From: Patrick Fink Date: Sat, 16 Jan 2021 16:51:28 +0100 Subject: [PATCH 2/2] Fix UDP rx buffer overflow Co-Authored-By: Christoph Schulz --- libraries/Bridge/src/BridgeUdp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Bridge/src/BridgeUdp.cpp b/libraries/Bridge/src/BridgeUdp.cpp index ae86cf42..768b5070 100644 --- a/libraries/Bridge/src/BridgeUdp.cpp +++ b/libraries/Bridge/src/BridgeUdp.cpp @@ -87,7 +87,7 @@ int BridgeUDP::parsePacket(){ } remote_ip = IPAddress(si_other.sin_addr.s_addr); remote_port = ntohs(si_other.sin_port); - rx_buffer = new cbuf(len); + rx_buffer = new cbuf(len+1); rx_buffer->write(buf, len); return len; }