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 authored and Simon Kelley committed 2021-09-20 21:20:41 +01:00
1 parent eb88eed1fc
commit c147329823
1 file changed
+1 -1
+1 -1
View File
@@ -1863,7 +1863,7 @@ unsigned char *tcp_request(int confd, time_t now,
int first, last;
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;
#ifdef HAVE_CONNTRACK