Check if allocation of 66573 bytes succeeded before accessing the memory to avoid crash in busy times

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
Dominik DL6ER
2021-09-18 16:05:34 +02:00
committed by Simon Kelley
parent eb88eed1fc
commit c147329823

View File

@@ -1863,7 +1863,7 @@ unsigned char *tcp_request(int confd, time_t now,
int first, last; int first, last;
unsigned int flags = 0; unsigned int flags = 0;
if (getpeername(confd, (struct sockaddr *)&peer_addr, &peer_len) == -1) if (!packet || getpeername(confd, (struct sockaddr *)&peer_addr, &peer_len) == -1)
return packet; return packet;
#ifdef HAVE_CONNTRACK #ifdef HAVE_CONNTRACK