From 3b36ae4b1ae674bfc8b4825e113187556b4ad624 Mon Sep 17 00:00:00 2001 From: David Perry Date: Wed, 17 Aug 2022 19:41:05 +0000 Subject: [PATCH] TCP tap: check if have seglen before using it --- epan/dissectors/packet-tcp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c index b926e5d5ace..83b0447ad51 100644 --- a/epan/dissectors/packet-tcp.c +++ b/epan/dissectors/packet-tcp.c @@ -1191,7 +1191,9 @@ follow_tcp_tap_listener(void *tapdata, packet_info *pinfo, const tcp_follow_tap_data_t *follow_data = (const tcp_follow_tap_data_t *)data; gboolean is_server; guint32 sequence = follow_data->tcph->th_seq; - guint32 length = follow_data->tcph->th_seglen; + guint32 length = follow_data->tcph->th_have_seglen + ? follow_data->tcph->th_seglen + : 0; guint32 data_offset = 0; guint32 data_length = tvb_captured_length(follow_data->tvb);