diff --git a/epan/dissectors/packet-3com-njack.c b/epan/dissectors/packet-3com-njack.c index b2d728af98..6202b12570 100644 --- a/epan/dissectors/packet-3com-njack.c +++ b/epan/dissectors/packet-3com-njack.c @@ -641,7 +641,7 @@ static gboolean test_njack(tvbuff_t *tvb) { /* We need at least 'NJ200' + 1 Byte packet type */ - if ( (tvb_length(tvb) < 6) || + if ( (tvb_captured_length(tvb) < 6) || (tvb_strncaseeql(tvb, 0, "NJ200", 5) != 0) ) { return FALSE; } diff --git a/epan/dissectors/packet-3g-a11.c b/epan/dissectors/packet-3g-a11.c index 78bf243aab..bd8b521c70 100644 --- a/epan/dissectors/packet-3g-a11.c +++ b/epan/dissectors/packet-3g-a11.c @@ -742,7 +742,7 @@ dissect_3gpp2_service_option_profile(proto_tree *tree, tvbuff_t *tvb, packet_i proto_tree_add_item(tree, hf_a11_serv_opt_prof_max_serv, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; - while (tvb_length_remaining(tvb,offset) > 0) { + while (tvb_reported_length_remaining(tvb,offset) > 0) { sub_type_length = tvb_get_guint8(tvb,offset+1); sub_type = tvb_get_guint8(tvb,offset); @@ -786,7 +786,7 @@ dissect_3gpp2_radius_aut_flow_profile_ids(proto_tree *tree, tvbuff_t *tvb, pac guint8 sub_type, sub_type_length; guint32 value; - while (tvb_length_remaining(tvb,offset) > 0) { + while (tvb_reported_length_remaining(tvb,offset) > 0) { sub_type = tvb_get_guint8(tvb,offset); sub_type_length = tvb_get_guint8(tvb,offset+1); /* value is 2 octets */ diff --git a/epan/dissectors/packet-6lowpan.c b/epan/dissectors/packet-6lowpan.c index e10162fccb..52075e1ba1 100644 --- a/epan/dissectors/packet-6lowpan.c +++ b/epan/dissectors/packet-6lowpan.c @@ -1829,10 +1829,10 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi if (!iphc_tvb) return NULL; /* Create the next header structure for the tunneled IPv6 header. */ - nhdr = (struct lowpan_nhdr *)wmem_alloc0(wmem_packet_scope(), sizeof(struct lowpan_nhdr) + tvb_length(iphc_tvb)); + nhdr = (struct lowpan_nhdr *)wmem_alloc0(wmem_packet_scope(), sizeof(struct lowpan_nhdr) + tvb_captured_length(iphc_tvb)); nhdr->next = NULL; nhdr->proto = IP_PROTO_IPV6; - nhdr->length = tvb_length(iphc_tvb); + nhdr->length = tvb_captured_length(iphc_tvb); nhdr->reported = tvb_reported_length(iphc_tvb); tvb_memcpy(iphc_tvb, LOWPAN_NHDR_DATA(nhdr), 0, nhdr->length); return nhdr; @@ -1911,8 +1911,8 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo, nhc_tree); /* Copy the remainder, and truncate the real buffer length. */ - nhdr->length = tvb_length_remaining(tvb, offset) + (int)sizeof(struct ip6_ext); - tvb_memcpy(tvb, LOWPAN_NHDR_DATA(nhdr) + sizeof(struct ip6_ext), offset, tvb_length_remaining(tvb, offset)); + nhdr->length = tvb_captured_length_remaining(tvb, offset) + (int)sizeof(struct ip6_ext); + tvb_memcpy(tvb, LOWPAN_NHDR_DATA(nhdr) + sizeof(struct ip6_ext), offset, tvb_captured_length_remaining(tvb, offset)); /* There is nothing more we can do. */ return nhdr; @@ -2092,7 +2092,7 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi /* Copy the UDP header and payload into the buffer. */ memcpy(LOWPAN_NHDR_DATA(nhdr), &udp, sizeof(struct udp_hdr)); - tvb_memcpy(tvb, LOWPAN_NHDR_DATA(nhdr) + sizeof(struct udp_hdr), offset, tvb_length_remaining(tvb, offset)); + tvb_memcpy(tvb, LOWPAN_NHDR_DATA(nhdr) + sizeof(struct udp_hdr), offset, tvb_captured_length_remaining(tvb, offset)); return nhdr; } /*===================================================== @@ -2324,7 +2324,7 @@ dissect_6lowpan_frag_first(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } /* Add this datagram to the fragment table. */ - frag_size = tvb_length(frag_tvb); + frag_size = tvb_captured_length(frag_tvb); tvb_set_reported_length(frag_tvb, frag_size); save_fragmented = pinfo->fragmented; pinfo->fragmented = TRUE; diff --git a/epan/dissectors/packet-aastra-aasp.c b/epan/dissectors/packet-aastra-aasp.c index 564f500d16..4a8f9f60f7 100644 --- a/epan/dissectors/packet-aastra-aasp.c +++ b/epan/dissectors/packet-aastra-aasp.c @@ -157,17 +157,17 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree { default: { - if(tvb_length(tvb) > 1) + if(tvb_reported_length(tvb) > 1) proto_tree_add_item(subtree, hf_a_data, tvb, 1, -1, ENC_NA); break; } case CONTEXT_INFO: { - for(i = 1; i 3) + if(tvb_reported_length(tvb) > 3) { proto_tree_add_item(subtree, hf_a_data, tvb, 1, 3, ENC_NA); proto_tree_add_item(subtree, hf_a_length, tvb, 4, 1, ENC_NA); @@ -231,7 +231,7 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree { proto_tree *infotree; - for(i=1; i 1) + if(tvb_reported_length(tvb) > 1) { proto_tree_add_item(subtree, hf_a_line, tvb, 1, 1, ENC_NA); proto_tree_add_item(subtree, hf_a_length, tvb, 2, 1, ENC_NA); @@ -387,7 +387,7 @@ dissect_aasp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ proto_item *ti; proto_tree *aasp_tree; guint n; /* Check that there's enough data */ - n = tvb_length(tvb); + n = tvb_reported_length(tvb); if(n < 3) return 0; col_clear(pinfo->cinfo, COL_INFO); diff --git a/epan/dissectors/packet-acn.c b/epan/dissectors/packet-acn.c index 124bf41141..d4a2183ded 100644 --- a/epan/dissectors/packet-acn.c +++ b/epan/dissectors/packet-acn.c @@ -456,7 +456,7 @@ is_acn(tvbuff_t *tvb) { static const char acn_packet_id[] = "ASC-E1.17\0\0\0"; /* must be 12 bytes */ - if (tvb_length(tvb) < (4+sizeof(acn_packet_id))) + if (tvb_captured_length(tvb) < (4+sizeof(acn_packet_id))) return FALSE; /* Check the bytes in octets 4 - 16 */ @@ -2756,7 +2756,7 @@ dissect_acn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (data_offset == old_offset) break; } } - return tvb_length(tvb); + return tvb_captured_length(tvb); } /******************************************************************************/ diff --git a/epan/dissectors/packet-actrace.c b/epan/dissectors/packet-actrace.c index e77132f123..c319736c4b 100644 --- a/epan/dissectors/packet-actrace.c +++ b/epan/dissectors/packet-actrace.c @@ -486,7 +486,7 @@ static int dissect_actrace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dissect_actrace_isdn(tvb, pinfo, tree, actrace_tree); break; } - return tvb_length(tvb); + return tvb_captured_length(tvb); } return 0;