From a8153d8ae525ac62f7bf10062a78cda945972467 Mon Sep 17 00:00:00 2001 From: "Marius Petrescu, YO2LOJ" Date: Sat, 16 Jan 2021 01:43:05 +0200 Subject: [PATCH] Update buffer allocation to the correct size Maximum size of ICMP packet is 64k while buffer allocation was UDP_BUFFER_LENMAX, while read was up to 64k. This will cause a crash on read in the subsequent read for packets with length greater than UDP_BUFFER_LENMAX via a buffer overflow. --- src/crawsocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crawsocket.cpp b/src/crawsocket.cpp index a30908d..119dbb1 100644 --- a/src/crawsocket.cpp +++ b/src/crawsocket.cpp @@ -92,7 +92,7 @@ int CRawSocket::Receive(CBuffer *Buffer, CIp *Ip, int timeout) if ( m_Socket != -1 ) { // allocate buffer - Buffer->resize(UDP_BUFFER_LENMAX); + Buffer->resize(RAW_BUFFER_LENMAX); // control socket FD_ZERO(&FdSet);