From 7238dad79296cbe94cb901a6d927cbe24eb92ee4 Mon Sep 17 00:00:00 2001 From: David Perry Date: Thu, 4 Aug 2022 03:23:18 +0000 Subject: Always use `next_tvb` for X.25 payload --- epan/dissectors/packet-x25.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'epan/dissectors/packet-x25.c') diff --git a/epan/dissectors/packet-x25.c b/epan/dissectors/packet-x25.c index 68b1b9535d..55537c4715 100644 --- a/epan/dissectors/packet-x25.c +++ b/epan/dissectors/packet-x25.c @@ -1940,9 +1940,9 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (payload_check_data){ /* If the Call Req. has not been captured, let's look at the first two bytes of the payload to see if this looks like COTP. */ - if (tvb_get_guint8(tvb, localoffset) == tvb_reported_length(next_tvb)-1) { + if (tvb_get_guint8(next_tvb, 0) == tvb_reported_length(next_tvb)-1) { /* First byte contains the length of the remaining buffer */ - if ((tvb_get_guint8(tvb, localoffset+1) & 0x0F) == 0) { + if ((tvb_get_guint8(next_tvb, 1) & 0x0F) == 0) { /* Second byte contains a valid COTP TPDU */ if (!pinfo->fd->visited) x25_hash_add_proto_start(vc, pinfo->num, ositp_handle); @@ -1953,7 +1953,7 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* Then let's look at the first byte of the payload to see if this looks like IP or CLNP. */ - switch (tvb_get_guint8(tvb, localoffset)) { + switch (tvb_get_guint8(next_tvb, 0)) { case 0x45: /* Looks like an IP header */ -- cgit v1.2.3