From 4997301a9d667dcdf06103de625159ad4a5c1593 Mon Sep 17 00:00:00 2001 From: William Robinet Date: Wed, 27 Jan 2021 18:32:18 +0100 Subject: [PATCH] Exit process_tcp_packet() in case TCP header is incomplete --- base/tcppack.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/base/tcppack.c b/base/tcppack.c index f44777f..1680e79 100644 --- a/base/tcppack.c +++ b/base/tcppack.c @@ -80,7 +80,10 @@ int process_tcp_packet(handler,ctx,p) int direction; stream_data *stream; tcp_conn *conn; - + + if(p->len < 20) + ABORT(1); + p->tcp=(struct tcphdr *)p->data; print_tcp_packet(p);