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
1 changed files with 1 additions and 1 deletions

View File

@ -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);