1
0
mirror of https://github.com/ShaYmez/xlxd.git synced 2025-08-04 06:12:28 -04:00

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.
This commit is contained in:
Marius Petrescu, YO2LOJ 2021-01-16 01:43:05 +02:00 committed by GitHub
parent cb989fd8de
commit a8153d8ae5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,7 +92,7 @@ int CRawSocket::Receive(CBuffer *Buffer, CIp *Ip, int timeout)
if ( m_Socket != -1 ) if ( m_Socket != -1 )
{ {
// allocate buffer // allocate buffer
Buffer->resize(UDP_BUFFER_LENMAX); Buffer->resize(RAW_BUFFER_LENMAX);
// control socket // control socket
FD_ZERO(&FdSet); FD_ZERO(&FdSet);