aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2014-06-06 10:35:50 -0400
committerPascal Quantin <pascal.quantin@gmail.com>2014-06-07 15:41:07 +0000
commit73217d9f3fbff3d9f5a514cd7f2b7f4ca5f61947 (patch)
tree194ce9f6db1db1237a755f832d34367d2df8320b /epan/dissectors
parenta048dc1d0d33728022831a538d878e967da88901 (diff)
tvb_new_subset -> tvb_new_subset_length when length parameters are equal.
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is. Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d Reviewed-on: https://code.wireshark.org/review/1999 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/file-jpeg.c2
-rw-r--r--epan/dissectors/file-png.c2
-rw-r--r--epan/dissectors/packet-6lowpan.c2
-rw-r--r--epan/dissectors/packet-a21.c2
-rw-r--r--epan/dissectors/packet-aastra-aasp.c2
-rw-r--r--epan/dissectors/packet-acr122.c4
-rw-r--r--epan/dissectors/packet-actrace.c2
-rw-r--r--epan/dissectors/packet-adb_cs.c2
-rw-r--r--epan/dissectors/packet-afp.c2
-rw-r--r--epan/dissectors/packet-aim.c2
-rw-r--r--epan/dissectors/packet-ansi_637.c2
-rw-r--r--epan/dissectors/packet-ansi_a.c8
-rw-r--r--epan/dissectors/packet-artnet.c2
-rw-r--r--epan/dissectors/packet-asap.c4
-rw-r--r--epan/dissectors/packet-asf.c2
-rw-r--r--epan/dissectors/packet-assa_r3.c48
-rw-r--r--epan/dissectors/packet-atm.c2
-rw-r--r--epan/dissectors/packet-bat.c6
-rw-r--r--epan/dissectors/packet-batadv.c50
-rw-r--r--epan/dissectors/packet-ber.c16
-rw-r--r--epan/dissectors/packet-bootp.c4
-rw-r--r--epan/dissectors/packet-bssap.c16
-rw-r--r--epan/dissectors/packet-bssgp.c8
-rw-r--r--epan/dissectors/packet-btavctp.c2
-rw-r--r--epan/dissectors/packet-bthci_cmd.c14
-rw-r--r--epan/dissectors/packet-bthci_evt.c16
-rw-r--r--epan/dissectors/packet-btle.c10
-rw-r--r--epan/dissectors/packet-btrfcomm.c2
-rw-r--r--epan/dissectors/packet-btsap.c8
-rw-r--r--epan/dissectors/packet-bzr.c2
-rw-r--r--epan/dissectors/packet-catapult-dct2000.c2
-rw-r--r--epan/dissectors/packet-cell_broadcast.c2
-rw-r--r--epan/dissectors/packet-cip.c12
-rw-r--r--epan/dissectors/packet-cisco-sm.c10
-rw-r--r--epan/dissectors/packet-cisco-wids.c6
-rw-r--r--epan/dissectors/packet-coap.c2
-rw-r--r--epan/dissectors/packet-cpfi.c2
-rw-r--r--epan/dissectors/packet-daap.c2
-rw-r--r--epan/dissectors/packet-db-lsp.c2
-rw-r--r--epan/dissectors/packet-diameter.c2
-rw-r--r--epan/dissectors/packet-dmp.c2
-rw-r--r--epan/dissectors/packet-dns.c6
-rw-r--r--epan/dissectors/packet-dpnss-link.c3
-rw-r--r--epan/dissectors/packet-drda.c2
-rw-r--r--epan/dissectors/packet-dtls.c3
-rw-r--r--epan/dissectors/packet-dua.c6
-rw-r--r--epan/dissectors/packet-dvb-data-mpe.c6
-rw-r--r--epan/dissectors/packet-dvbci.c20
-rw-r--r--epan/dissectors/packet-ehdlc.c4
-rw-r--r--epan/dissectors/packet-eigrp.c2
-rw-r--r--epan/dissectors/packet-eiss.c2
-rw-r--r--epan/dissectors/packet-enip.c8
-rw-r--r--epan/dissectors/packet-enrp.c4
-rw-r--r--epan/dissectors/packet-etsi_card_app_toolkit.c2
-rw-r--r--epan/dissectors/packet-etv.c2
-rw-r--r--epan/dissectors/packet-fc.c6
-rw-r--r--epan/dissectors/packet-fcp.c2
-rw-r--r--epan/dissectors/packet-flip.c9
-rw-r--r--epan/dissectors/packet-forces.c2
-rw-r--r--epan/dissectors/packet-gdb.c4
-rw-r--r--epan/dissectors/packet-gpef.c2
-rw-r--r--epan/dissectors/packet-gprs-llc.c6
-rw-r--r--epan/dissectors/packet-gsm_a_bssmap.c16
-rw-r--r--epan/dissectors/packet-gsm_a_dtap.c4
-rw-r--r--epan/dissectors/packet-gsm_a_gm.c7
-rw-r--r--epan/dissectors/packet-gsm_a_rp.c2
-rw-r--r--epan/dissectors/packet-gsm_a_rr.c6
-rw-r--r--epan/dissectors/packet-gsm_abis_oml.c4
-rw-r--r--epan/dissectors/packet-gsm_bsslap.c2
-rw-r--r--epan/dissectors/packet-gsm_bssmap_le.c4
-rw-r--r--epan/dissectors/packet-gsm_ipa.c2
-rw-r--r--epan/dissectors/packet-gsm_rlcmac.c12
-rw-r--r--epan/dissectors/packet-gsm_sim.c8
-rw-r--r--epan/dissectors/packet-gsmtap.c8
-rw-r--r--epan/dissectors/packet-gtp.c14
-rw-r--r--epan/dissectors/packet-gtpv2.c10
-rw-r--r--epan/dissectors/packet-h223.c9
-rw-r--r--epan/dissectors/packet-h248.c6
-rw-r--r--epan/dissectors/packet-hdmi.c4
-rw-r--r--epan/dissectors/packet-hpfeeds.c2
-rw-r--r--epan/dissectors/packet-http.c2
-rw-r--r--epan/dissectors/packet-ieee17221.c14
-rw-r--r--epan/dissectors/packet-ieee80211.c2
-rw-r--r--epan/dissectors/packet-ifcp.c2
-rw-r--r--epan/dissectors/packet-ipdc.c2
-rw-r--r--epan/dissectors/packet-ipmi-se.c4
-rw-r--r--epan/dissectors/packet-ipsec.c6
-rw-r--r--epan/dissectors/packet-isakmp.c2
-rw-r--r--epan/dissectors/packet-isl.c2
-rw-r--r--epan/dissectors/packet-isup.c2
-rw-r--r--epan/dissectors/packet-iua.c6
-rw-r--r--epan/dissectors/packet-iuup.c2
-rw-r--r--epan/dissectors/packet-iwarp-mpa.c7
-rw-r--r--epan/dissectors/packet-ixveriwave.c6
-rw-r--r--epan/dissectors/packet-jxta.c8
-rw-r--r--epan/dissectors/packet-kafka.c2
-rw-r--r--epan/dissectors/packet-kpasswd.c2
-rw-r--r--epan/dissectors/packet-l2tp.c8
-rw-r--r--epan/dissectors/packet-lapbether.c2
-rw-r--r--epan/dissectors/packet-lapd.c2
-rw-r--r--epan/dissectors/packet-lbmc.c27
-rw-r--r--epan/dissectors/packet-lbmr.c2
-rw-r--r--epan/dissectors/packet-lbtrm.c2
-rw-r--r--epan/dissectors/packet-lbtru.c2
-rw-r--r--epan/dissectors/packet-ldap.c7
-rw-r--r--epan/dissectors/packet-linx.c4
-rw-r--r--epan/dissectors/packet-lldp.c2
-rw-r--r--epan/dissectors/packet-lte-rrc.c2
-rw-r--r--epan/dissectors/packet-ltp.c2
-rw-r--r--epan/dissectors/packet-m2pa.c6
-rw-r--r--epan/dissectors/packet-m2tp.c6
-rw-r--r--epan/dissectors/packet-m2ua.c14
-rw-r--r--epan/dissectors/packet-m3ua.c24
-rw-r--r--epan/dissectors/packet-mac-lte.c6
-rw-r--r--epan/dissectors/packet-macsec.c2
-rw-r--r--epan/dissectors/packet-mbim.c22
-rw-r--r--epan/dissectors/packet-mbtcp.c4
-rw-r--r--epan/dissectors/packet-mdshdr.c2
-rw-r--r--epan/dissectors/packet-megaco.c2
-rw-r--r--epan/dissectors/packet-mih.c2
-rw-r--r--epan/dissectors/packet-mikey.c6
-rw-r--r--epan/dissectors/packet-mint.c2
-rw-r--r--epan/dissectors/packet-mip.c2
-rw-r--r--epan/dissectors/packet-mip6.c8
-rw-r--r--epan/dissectors/packet-mp2t.c2
-rw-r--r--epan/dissectors/packet-mpeg-dsmcc.c6
-rw-r--r--epan/dissectors/packet-mpeg-pes.c4
-rw-r--r--epan/dissectors/packet-mstp.c4
-rw-r--r--epan/dissectors/packet-mtp2.c4
-rw-r--r--epan/dissectors/packet-mtp3.c11
-rw-r--r--epan/dissectors/packet-multipart.c3
-rw-r--r--epan/dissectors/packet-nas_eps.c14
-rw-r--r--epan/dissectors/packet-nasdaq-soup.c2
-rw-r--r--epan/dissectors/packet-nflog.c2
-rw-r--r--epan/dissectors/packet-nwmtp.c2
-rw-r--r--epan/dissectors/packet-openflow_v1.c4
-rw-r--r--epan/dissectors/packet-openflow_v4.c4
-rw-r--r--epan/dissectors/packet-openflow_v5.c4
-rw-r--r--epan/dissectors/packet-openwire.c4
-rw-r--r--epan/dissectors/packet-ossp.c2
-rw-r--r--epan/dissectors/packet-packetlogger.c2
-rw-r--r--epan/dissectors/packet-pana.c6
-rw-r--r--epan/dissectors/packet-pdc.c6
-rw-r--r--epan/dissectors/packet-per.c2
-rw-r--r--epan/dissectors/packet-ppp.c4
-rw-r--r--epan/dissectors/packet-pw-atm.c8
-rw-r--r--epan/dissectors/packet-pw-cesopsn.c4
-rw-r--r--epan/dissectors/packet-pw-fr.c2
-rw-r--r--epan/dissectors/packet-pw-satop.c4
-rw-r--r--epan/dissectors/packet-q931.c11
-rw-r--r--epan/dissectors/packet-q932-ros.c6
-rw-r--r--epan/dissectors/packet-q932.c2
-rw-r--r--epan/dissectors/packet-quake.c11
-rw-r--r--epan/dissectors/packet-quake2.c7
-rw-r--r--epan/dissectors/packet-quake3.c3
-rw-r--r--epan/dissectors/packet-quakeworld.c3
-rw-r--r--epan/dissectors/packet-radius.c2
-rw-r--r--epan/dissectors/packet-rfid-pn532-hci.c4
-rw-r--r--epan/dissectors/packet-rfid-pn532.c2
-rw-r--r--epan/dissectors/packet-rlc-lte.c6
-rw-r--r--epan/dissectors/packet-rpcap.c2
-rw-r--r--epan/dissectors/packet-rsl.c14
-rw-r--r--epan/dissectors/packet-rsvp.c2
-rw-r--r--epan/dissectors/packet-rtcp.c4
-rw-r--r--epan/dissectors/packet-rtmpt.c6
-rw-r--r--epan/dissectors/packet-rtp.c10
-rw-r--r--epan/dissectors/packet-rudp.c2
-rw-r--r--epan/dissectors/packet-sabp.c2
-rw-r--r--epan/dissectors/packet-sccp.c15
-rw-r--r--epan/dissectors/packet-scsi-osd.c2
-rw-r--r--epan/dissectors/packet-sdp.c6
-rw-r--r--epan/dissectors/packet-selfm.c2
-rw-r--r--epan/dissectors/packet-sercosiii.c16
-rw-r--r--epan/dissectors/packet-ses.c2
-rw-r--r--epan/dissectors/packet-sgsap.c2
-rw-r--r--epan/dissectors/packet-sigcomp.c8
-rw-r--r--epan/dissectors/packet-sip.c4
-rw-r--r--epan/dissectors/packet-smb-direct.c4
-rw-r--r--epan/dissectors/packet-smb.c21
-rw-r--r--epan/dissectors/packet-smb2.c4
-rw-r--r--epan/dissectors/packet-sndcp-xid.c4
-rw-r--r--epan/dissectors/packet-snmp.c2
-rw-r--r--epan/dissectors/packet-spice.c6
-rw-r--r--epan/dissectors/packet-spnego.c20
-rw-r--r--epan/dissectors/packet-srp.c2
-rw-r--r--epan/dissectors/packet-sscop.c2
-rw-r--r--epan/dissectors/packet-stun.c2
-rw-r--r--epan/dissectors/packet-sua.c8
-rw-r--r--epan/dissectors/packet-tacacs.c2
-rw-r--r--epan/dissectors/packet-tcap.c7
-rw-r--r--epan/dissectors/packet-telnet.c4
-rw-r--r--epan/dissectors/packet-tetra.c4
-rw-r--r--epan/dissectors/packet-tipc.c6
-rw-r--r--epan/dissectors/packet-tnef.c4
-rw-r--r--epan/dissectors/packet-ua.c4
-rw-r--r--epan/dissectors/packet-uasip.c4
-rw-r--r--epan/dissectors/packet-uaudp.c4
-rw-r--r--epan/dissectors/packet-ucp.c2
-rw-r--r--epan/dissectors/packet-uma.c10
-rw-r--r--epan/dissectors/packet-umts_fp.c6
-rw-r--r--epan/dissectors/packet-usb-ccid.c2
-rw-r--r--epan/dissectors/packet-usb.c4
-rw-r--r--epan/dissectors/packet-user_encap.c4
-rw-r--r--epan/dissectors/packet-v52.c66
-rw-r--r--epan/dissectors/packet-v5ua.c10
-rw-r--r--epan/dissectors/packet-wassp.c4
-rw-r--r--epan/dissectors/packet-winsrepl.c2
-rw-r--r--epan/dissectors/packet-wsp.c32
-rw-r--r--epan/dissectors/packet-wtp.c4
-rw-r--r--epan/dissectors/packet-xmcp.c2
-rw-r--r--epan/dissectors/packet-xml.c6
-rw-r--r--epan/dissectors/packet-zbee-aps.c5
-rw-r--r--epan/dissectors/packet-zbee-nwk-gp.c2
-rw-r--r--epan/dissectors/packet-zbee-nwk.c6
-rw-r--r--epan/dissectors/packet-zbee-security.c2
-rw-r--r--epan/dissectors/packet-zbee-zcl.c2
-rw-r--r--epan/dissectors/packet-zbee-zdp.c2
-rw-r--r--epan/dissectors/packet-zep.c2
218 files changed, 629 insertions, 676 deletions
diff --git a/epan/dissectors/file-jpeg.c b/epan/dissectors/file-jpeg.c
index f5865e3d39..cd3c42339e 100644
--- a/epan/dissectors/file-jpeg.c
+++ b/epan/dissectors/file-jpeg.c
@@ -819,7 +819,7 @@ dissect_jfif(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
if (marker_has_length(marker)) { /* Marker segment */
/* Length of marker segment = 2 + len */
const guint16 len = tvb_get_ntohs(tvb, start_marker + 2);
- tvbuff_t *tmp_tvb = tvb_new_subset(tvb, start_marker, 2 + len, 2 + len);
+ tvbuff_t *tmp_tvb = tvb_new_subset_length(tvb, start_marker, 2 + len);
switch (marker) {
case MARKER_APP0:
process_app0_segment(subtree, tmp_tvb, len, marker, str);
diff --git a/epan/dissectors/file-png.c b/epan/dissectors/file-png.c
index b01da114a5..4d19f19da8 100644
--- a/epan/dissectors/file-png.c
+++ b/epan/dissectors/file-png.c
@@ -490,7 +490,7 @@ dissect_png(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *da
proto_tree_add_item(chunk_tree, &hfi_png_chunk_flag_stc, tvb, offset, 4, ENC_BIG_ENDIAN);
offset+=4;
- chunk_tvb=tvb_new_subset(tvb, offset, len_field, len_field);
+ chunk_tvb=tvb_new_subset_length(tvb, offset, len_field);
switch (type) {
case CHUNK_TYPE_IHDR:
dissect_png_ihdr(chunk_tvb, pinfo, chunk_tree);
diff --git a/epan/dissectors/packet-6lowpan.c b/epan/dissectors/packet-6lowpan.c
index 0063b15ee5..ba132664f5 100644
--- a/epan/dissectors/packet-6lowpan.c
+++ b/epan/dissectors/packet-6lowpan.c
@@ -1895,7 +1895,7 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi
}
/* Display the extension header using the data dissector. */
- call_dissector(data_handle, tvb_new_subset(tvb, offset, ext_len, ext_len), pinfo, nhc_tree);
+ call_dissector(data_handle, tvb_new_subset_length(tvb, offset, ext_len), pinfo, nhc_tree);
/* Copy the extension header into the struct. */
tvb_memcpy(tvb, LOWPAN_NHDR_DATA(nhdr) + sizeof(struct ip6_ext), offset, ext_len);
diff --git a/epan/dissectors/packet-a21.c b/epan/dissectors/packet-a21.c
index 31acf42a96..a5ebe028bb 100644
--- a/epan/dissectors/packet-a21.c
+++ b/epan/dissectors/packet-a21.c
@@ -367,7 +367,7 @@ dissect_a21_gcsna_pdu(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, p
/* only dissect it to octetstring */
proto_tree_add_item(tree, hf_a21_gcsna_content, tvb, offset, length, ENC_NA);
if(gcsna_handle){
- new_tvb = tvb_new_subset(tvb, offset, length, length);
+ new_tvb = tvb_new_subset_length(tvb, offset, length);
/* call the dissector with the parent (top)tree */
call_dissector(gcsna_handle, new_tvb, pinfo, a21_tree->parent);
}
diff --git a/epan/dissectors/packet-aastra-aasp.c b/epan/dissectors/packet-aastra-aasp.c
index cd42ba7304..564f500d16 100644
--- a/epan/dissectors/packet-aastra-aasp.c
+++ b/epan/dissectors/packet-aastra-aasp.c
@@ -433,7 +433,7 @@ dissect_aasp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
#endif
default: i = searchNext(tvb, i+1, n); break;
}
- dissect_a_binary_command(tvb_new_subset(tvb, prev, i-prev, i-prev), pinfo, aasp_tree);
+ dissect_a_binary_command(tvb_new_subset_length(tvb, prev, i-prev), pinfo, aasp_tree);
prev = i;
}
}
diff --git a/epan/dissectors/packet-acr122.c b/epan/dissectors/packet-acr122.c
index feb3026d4d..47bdb72eb7 100644
--- a/epan/dissectors/packet-acr122.c
+++ b/epan/dissectors/packet-acr122.c
@@ -342,7 +342,7 @@ dissect_acr122(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
switch (command) {
case CMD_DIRECT_TRANSMIT:
if (length > 0) {
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector_with_data(pn532_handle, next_tvb, pinfo, tree, usb_conv_info);
offset += length;
}
@@ -523,7 +523,7 @@ dissect_acr122(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
use_status_word = TRUE;
if (tvb_length_remaining(tvb, offset) > 2) {
- next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset) - 2, tvb_length_remaining(tvb, offset) - 2);
+ next_tvb = tvb_new_subset_length(tvb, offset, tvb_length_remaining(tvb, offset) - 2);
call_dissector_with_data(pn532_handle, next_tvb, pinfo, tree, usb_conv_info);
offset += tvb_length_remaining(tvb, offset) - 2;
}
diff --git a/epan/dissectors/packet-actrace.c b/epan/dissectors/packet-actrace.c
index 8a850c0ae8..ecfb860bda 100644
--- a/epan/dissectors/packet-actrace.c
+++ b/epan/dissectors/packet-actrace.c
@@ -685,7 +685,7 @@ static void dissect_actrace_isdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
/* Dissect lapd payload */
offset += 2 ;
- next_tvb = tvb_new_subset(tvb, offset, len, len);
+ next_tvb = tvb_new_subset_length(tvb, offset, len);
call_dissector(lapd_handle, next_tvb, pinfo, tree);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "AC_ISDN");
diff --git a/epan/dissectors/packet-adb_cs.c b/epan/dissectors/packet-adb_cs.c
index ffbefa7491..dd3ec9c8cb 100644
--- a/epan/dissectors/packet-adb_cs.c
+++ b/epan/dissectors/packet-adb_cs.c
@@ -688,7 +688,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
}
if (tvb_length_remaining(next_tvb, i_offset) >= 4 && tvb_length_remaining(next_tvb, i_offset) >= logcat_length) {
- new_tvb = tvb_new_subset(next_tvb, i_offset, logcat_length, logcat_length);
+ new_tvb = tvb_new_subset_length(next_tvb, i_offset, logcat_length);
call_dissector(logcat_handle, new_tvb, pinfo, main_tree);
i_offset += logcat_length;
diff --git a/epan/dissectors/packet-afp.c b/epan/dissectors/packet-afp.c
index ded8c5a4d3..3bb4202062 100644
--- a/epan/dissectors/packet-afp.c
+++ b/epan/dissectors/packet-afp.c
@@ -4430,7 +4430,7 @@ spotlight_dissect_query_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
} else {
item_query = proto_tree_add_text(tree, tvb, offset, query_length, "filemeta");
sub_tree = proto_item_add_subtree(item_query, ett_afp_spotlight_query_line);
- spotlight_tvb = tvb_new_subset(tvb, offset+8, query_length, query_length);
+ spotlight_tvb = tvb_new_subset_length(tvb, offset+8, query_length);
call_dissector(spotlight_handle, spotlight_tvb, pinfo, sub_tree);
}
break;
diff --git a/epan/dissectors/packet-aim.c b/epan/dissectors/packet-aim.c
index c78f0e4dd4..f3616b2f5c 100644
--- a/epan/dissectors/packet-aim.c
+++ b/epan/dissectors/packet-aim.c
@@ -1346,7 +1346,7 @@ dissect_aim_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, int offset,
"Value");
if (tmp[i].dissector) {
- tmp[i].dissector(ti1, valueid, tvb_new_subset(tvb, offset, length, length), pinfo);
+ tmp[i].dissector(ti1, valueid, tvb_new_subset_length(tvb, offset, length), pinfo);
}
offset += length;
diff --git a/epan/dissectors/packet-ansi_637.c b/epan/dissectors/packet-ansi_637.c
index e5c2b944ec..d627527e72 100644
--- a/epan/dissectors/packet-ansi_637.c
+++ b/epan/dissectors/packet-ansi_637.c
@@ -2164,7 +2164,7 @@ trans_param_bearer_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_,
/*
* dissect the embedded teleservice data
*/
- tele_tvb = tvb_new_subset(tvb, offset, len, len);
+ tele_tvb = tvb_new_subset_length(tvb, offset, len);
dissector_try_uint(tele_dissector_table, ansi_637_trans_tele_id, tele_tvb, pinfo, g_tree);
}
diff --git a/epan/dissectors/packet-ansi_a.c b/epan/dissectors/packet-ansi_a.c
index edd778d7b8..634ec666d8 100644
--- a/epan/dissectors/packet-ansi_a.c
+++ b/epan/dissectors/packet-ansi_a.c
@@ -3721,7 +3721,7 @@ elem_l3_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset
/*
* dissect the embedded DTAP message
*/
- l3_tvb = tvb_new_subset(tvb, curr_offset, len, len);
+ l3_tvb = tvb_new_subset_length(tvb, curr_offset, len);
call_dissector(dtap_handle, l3_tvb, pinfo, data_p->g_tree);
@@ -4780,14 +4780,14 @@ elem_adds_user_part(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32
switch (oct & 0x3f)
{
case ADDS_APP_SMS:
- adds_tvb = tvb_new_subset(tvb, curr_offset, len - 1, len - 1);
+ adds_tvb = tvb_new_subset_length(tvb, curr_offset, len - 1);
dissector_try_uint(is637_dissector_table, 0, adds_tvb, pinfo, data_p->g_tree);
curr_offset += (len - 1);
break;
case ADDS_APP_OTA:
- adds_tvb = tvb_new_subset(tvb, curr_offset, len - 1, len - 1);
+ adds_tvb = tvb_new_subset_length(tvb, curr_offset, len - 1);
dissector_try_uint(is683_dissector_table, data_p->is_reverse, adds_tvb, pinfo, data_p->g_tree);
@@ -4795,7 +4795,7 @@ elem_adds_user_part(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32
break;
case ADDS_APP_PDS:
- adds_tvb = tvb_new_subset(tvb, curr_offset, len - 1, len - 1);
+ adds_tvb = tvb_new_subset_length(tvb, curr_offset, len - 1);
dissector_try_uint(is801_dissector_table, data_p->is_reverse, adds_tvb, pinfo, data_p->g_tree);
diff --git a/epan/dissectors/packet-artnet.c b/epan/dissectors/packet-artnet.c
index 9399597f14..bf233212f1 100644
--- a/epan/dissectors/packet-artnet.c
+++ b/epan/dissectors/packet-artnet.c
@@ -1638,7 +1638,7 @@ dissect_artnet_output(tvbuff_t *tvb, guint offset, proto_tree *tree, packet_info
save_info = col_get_writable(pinfo->cinfo);
col_set_writable(pinfo->cinfo, FALSE);
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
/* XXX: Assumption: OK to call dmx-chan dissector under 'if (tree)' */
call_dissector(dmx_chan_handle, next_tvb, pinfo, base_tree);
diff --git a/epan/dissectors/packet-asap.c b/epan/dissectors/packet-asap.c
index 8742ccca24..4c1e6de52c 100644
--- a/epan/dissectors/packet-asap.c
+++ b/epan/dissectors/packet-asap.c
@@ -229,7 +229,7 @@ dissect_error_causes(tvbuff_t *error_causes_tvb, proto_tree *parameter_tree)
while(tvb_reported_length_remaining(error_causes_tvb, offset) > 0) {
length = tvb_get_ntohs(error_causes_tvb, offset + CAUSE_LENGTH_OFFSET);
total_length = ADD_PADDING(length);
- error_cause_tvb = tvb_new_subset(error_causes_tvb, offset , total_length, total_length);
+ error_cause_tvb = tvb_new_subset_length(error_causes_tvb, offset , total_length);
dissect_error_cause(error_cause_tvb, parameter_tree);
offset += total_length;
}
@@ -728,7 +728,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, proto_tree *tree)
if (remaining_length >= length)
total_length = MIN(total_length, remaining_length);
/* create a tvb for the parameter including the padding bytes */
- parameter_tvb = tvb_new_subset(parameters_tvb, offset, total_length, total_length);
+ parameter_tvb = tvb_new_subset_length(parameters_tvb, offset, total_length);
dissect_parameter(parameter_tvb, tree);
/* get rid of the handled parameter */
offset += total_length;
diff --git a/epan/dissectors/packet-asf.c b/epan/dissectors/packet-asf.c
index 5ab0cab855..69a14c6659 100644
--- a/epan/dissectors/packet-asf.c
+++ b/epan/dissectors/packet-asf.c
@@ -189,7 +189,7 @@ dissect_asf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
/* TODO: Add the rest as captures become available to test. */
default:
- next_tvb = tvb_new_subset(tvb, 8, len, len);
+ next_tvb = tvb_new_subset_length(tvb, 8, len);
call_dissector(data_handle, next_tvb, pinfo, tree);
break;
}
diff --git a/epan/dissectors/packet-assa_r3.c b/epan/dissectors/packet-assa_r3.c
index f570277682..3dcbf82725 100644
--- a/epan/dissectors/packet-assa_r3.c
+++ b/epan/dissectors/packet-assa_r3.c
@@ -3596,7 +3596,7 @@ dissect_r3_upstreamfields (tvbuff_t *tvb, guint32 start_offset, guint32 length,
*/
case UPSTREAMFIELD_SERIALNUMBER :
{
- tvbuff_t *sn_tvb = tvb_new_subset (tvb, offset, dataLength, dataLength);
+ tvbuff_t *sn_tvb = tvb_new_subset_length (tvb, offset, dataLength);
dissect_serialnumber (sn_tvb, 0, length, pinfo, upstreamfield_tree, hf_r3_upstreamfieldarray [fieldType]);
}
@@ -5055,7 +5055,7 @@ dissect_r3_response_hasdata (tvbuff_t *tvb, guint32 start_offset, guint32 length
}
tvb_ensure_bytes_exist (tvb, 0, commandPacketLen - 4);
- upstreamcommand_tvb = tvb_new_subset (tvb, 4, commandPacketLen - 4, commandPacketLen - 4);
+ upstreamcommand_tvb = tvb_new_subset_length (tvb, 4, commandPacketLen - 4);
if (r3upstreamcommand_dissect [upstreamCmd])
(*r3upstreamcommand_dissect [upstreamCmd]) (upstreamcommand_tvb, 0, commandPacketLen - 4, pinfo, upstreamcommand_tree);
}
@@ -5071,7 +5071,7 @@ dissect_r3_cmd_response (tvbuff_t *tvb, guint32 start_offset, guint32 length, pa
{
guint8 responseLen = tvb_get_guint8 (tvb, start_offset + 0);
responseType_e responseType = (responseType_e)tvb_get_guint8 (tvb, start_offset + 2);
- tvbuff_t *payload_tvb = tvb_new_subset (tvb, start_offset, responseLen, responseLen);
+ tvbuff_t *payload_tvb = tvb_new_subset_length (tvb, start_offset, responseLen);
if (tree)
{
@@ -5147,7 +5147,7 @@ dissect_r3_cmd_setdatetime (tvbuff_t *tvb, guint32 start_offset, guint32 length
return;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -5193,7 +5193,7 @@ dissect_r3_cmd_setconfig (tvbuff_t *tvb, guint32 start_offset, guint32 length _U
return;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -5295,7 +5295,7 @@ static void
dissect_r3_cmd_manageuser (tvbuff_t *tvb, guint32 start_offset, guint32 length _U_, packet_info *pinfo, proto_tree *tree)
{
guint8 cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- tvbuff_t *payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ tvbuff_t *payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
guint32 offset = 0;
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
@@ -5436,7 +5436,7 @@ dissect_r3_cmd_deleteusers (tvbuff_t *tvb, guint32 start_offset, guint32 length
return;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -5458,7 +5458,7 @@ dissect_r3_cmd_defineexception (tvbuff_t *tvb, guint32 start_offset, guint32 len
return;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -5504,7 +5504,7 @@ dissect_r3_cmd_defineexceptiongroup (tvbuff_t *tvb, guint32 start_offset, guint3
return;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -5537,7 +5537,7 @@ dissect_r3_cmd_definecalendar (tvbuff_t *tvb, guint32 start_offset, guint32 leng
return;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -5581,7 +5581,7 @@ dissect_r3_cmd_definetimezone (tvbuff_t *tvb, guint32 start_offset, guint32 leng
return;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -5628,7 +5628,7 @@ dissect_r3_cmd_rmtauthretry (tvbuff_t *tvb, guint32 start_offset, guint32 length
return;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -5650,7 +5650,7 @@ dissect_r3_cmd_filters (tvbuff_t *tvb, guint32 start_offset, guint32 length _U_,
return;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -5679,7 +5679,7 @@ dissect_r3_cmd_alarmconfigure (tvbuff_t *tvb, guint32 start_offset, guint32 leng
return;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -5741,7 +5741,7 @@ dissect_r3_cmd_eventlogdump (tvbuff_t *tvb, guint32 start_offset, guint32 length
return;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -5791,7 +5791,7 @@ dissect_r3_cmd_declinedlogdump (tvbuff_t *tvb, guint32 start_offset, guint32 len
return;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -5839,7 +5839,7 @@ dissect_r3_cmd_alarmlogdump (tvbuff_t *tvb, guint32 start_offset, guint32 length
return;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -5885,7 +5885,7 @@ dissect_r3_cmd_downloadfirmware (tvbuff_t *tvb, guint32 start_offset, guint32 le
guint32 calculatedCRC;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
if (tree)
{
@@ -5979,7 +5979,7 @@ dissect_r3_cmd_downloadfirmwaretimeout (tvbuff_t *tvb, guint32 start_offset, gui
if (tree)
{
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -5999,7 +5999,7 @@ dissect_r3_cmd_powertableselection (tvbuff_t *tvb, guint32 start_offset, guint32
return;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -6021,7 +6021,7 @@ dissect_r3_cmd_clearnvram (tvbuff_t *tvb, guint32 start_offset, guint32 length _
return;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -6045,7 +6045,7 @@ dissect_r3_cmd_dpac (tvbuff_t *tvb, guint32 start_offset, guint32 length _U_, pa
return;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -6086,7 +6086,7 @@ dissect_r3_cmd_logwrite (tvbuff_t *tvb, guint32 start_offset, guint32 length _U_
return;
cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
- payload_tvb = tvb_new_subset (tvb, start_offset + 2, cmdLen - 2, cmdLen - 2);
+ payload_tvb = tvb_new_subset_length (tvb, start_offset + 2, cmdLen - 2);
proto_tree_add_item (tree, hf_r3_commandlength, tvb, start_offset + 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_command, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
@@ -6132,7 +6132,7 @@ dissect_r3_cmd_extendedresponse (tvbuff_t *tvb, guint32 start_offset, guint32 le
static void
dissect_r3_cmdmfg_setserialnumber (tvbuff_t *tvb, guint32 start_offset, guint32 length _U_, packet_info *pinfo _U_, proto_tree *tree)
{
- tvbuff_t *sn_tvb = tvb_new_subset (tvb, start_offset + 2, 16, 16);
+ tvbuff_t *sn_tvb = tvb_new_subset_length (tvb, start_offset + 2, 16);
if (tree)
{
diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c
index ac8eeae454..f3232b8435 100644
--- a/epan/dissectors/packet-atm.c
+++ b/epan/dissectors/packet-atm.c
@@ -1096,7 +1096,7 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
ti = proto_tree_add_uint(atm_tree, hf_atm_aal5_crc, tvb, length - 4, 4, crc);
proto_item_append_text(ti, (calc_crc == 0xC704DD7B) ? " (correct)" : " (incorrect)");
}
- next_tvb = tvb_new_subset(tvb, 0, aal5_length, aal5_length);
+ next_tvb = tvb_new_subset_length(tvb, 0, aal5_length);
}
}
}
diff --git a/epan/dissectors/packet-bat.c b/epan/dissectors/packet-bat.c
index 04e4e3f3d9..ffea48911c 100644
--- a/epan/dissectors/packet-bat.c
+++ b/epan/dissectors/packet-bat.c
@@ -313,7 +313,7 @@ static int dissect_bat_batman_v5(tvbuff_t *tvb, int offset, packet_info *pinfo,
tap_queue_packet(bat_tap, pinfo, batman_packeth);
for (i = 0; i < batman_packeth->hna_len; i++) {
- next_tvb = tvb_new_subset(tvb, offset, 5, 5);
+ next_tvb = tvb_new_subset_length(tvb, offset, 5);
if (have_tap_listener(bat_follow_tap)) {
tap_queue_packet(bat_follow_tap, pinfo, next_tvb);
@@ -517,7 +517,7 @@ static void dissect_bat_vis_v22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
length_remaining = tvb_reported_length_remaining(tvb, offset);
for (i = 0; i < length_remaining; i += VIS_PACKET_V22_DATA_SIZE) {
- next_tvb = tvb_new_subset(tvb, offset, VIS_PACKET_V22_DATA_SIZE, VIS_PACKET_V22_DATA_SIZE);
+ next_tvb = tvb_new_subset_length(tvb, offset, VIS_PACKET_V22_DATA_SIZE);
if (have_tap_listener(bat_follow_tap)) {
tap_queue_packet(bat_follow_tap, pinfo, next_tvb);
@@ -650,7 +650,7 @@ static void dissect_bat_vis_v23(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
length_remaining = tvb_reported_length_remaining(tvb, offset);
for (i = 0; i < length_remaining; i += VIS_PACKET_V23_DATA_SIZE) {
- next_tvb = tvb_new_subset(tvb, offset, VIS_PACKET_V23_DATA_SIZE, VIS_PACKET_V23_DATA_SIZE);
+ next_tvb = tvb_new_subset_length(tvb, offset, VIS_PACKET_V23_DATA_SIZE);
if (have_tap_listener(bat_follow_tap)) {
tap_queue_packet(bat_follow_tap, pinfo, next_tvb);
diff --git a/epan/dissectors/packet-batadv.c b/epan/dissectors/packet-batadv.c
index 1a52fc45d5..3a6b5ae13f 100644
--- a/epan/dissectors/packet-batadv.c
+++ b/epan/dissectors/packet-batadv.c
@@ -630,7 +630,7 @@ static void dissect_batman_plugin(tvbuff_t *tvb, packet_info *pinfo, proto_tree
length_remaining = tvb_length_remaining(tvb, 0);
if (length_remaining > 0) {
- next_tvb = tvb_new_subset(tvb, 0, length_remaining, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 0);
call_dissector(data_handle, next_tvb, pinfo, tree);
}
break;
@@ -808,7 +808,7 @@ static int dissect_batadv_batman_v5(tvbuff_t *tvb, int offset, packet_info *pinf
tap_queue_packet(batadv_tap, pinfo, batman_packeth);
for (i = 0; i < batman_packeth->num_tt; i++) {
- next_tvb = tvb_new_subset(tvb, offset, 6, 6);
+ next_tvb = tvb_new_subset_length(tvb, offset, 6);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -909,7 +909,7 @@ static int dissect_batadv_batman_v7(tvbuff_t *tvb, int offset, packet_info *pinf
tap_queue_packet(batadv_tap, pinfo, batman_packeth);
for (i = 0; i < batman_packeth->num_tt; i++) {
- next_tvb = tvb_new_subset(tvb, offset, 6, 6);
+ next_tvb = tvb_new_subset_length(tvb, offset, 6);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -1019,7 +1019,7 @@ static int dissect_batadv_batman_v9(tvbuff_t *tvb, int offset, packet_info *pinf
tap_queue_packet(batadv_tap, pinfo, batman_packeth);
for (i = 0; i < batman_packeth->num_tt; i++) {
- next_tvb = tvb_new_subset(tvb, offset, 6, 6);
+ next_tvb = tvb_new_subset_length(tvb, offset, 6);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -1129,7 +1129,7 @@ static int dissect_batadv_batman_v10(tvbuff_t *tvb, int offset, packet_info *pin
tap_queue_packet(batadv_tap, pinfo, batman_packeth);
for (i = 0; i < batman_packeth->num_tt; i++) {
- next_tvb = tvb_new_subset(tvb, offset, 6, 6);
+ next_tvb = tvb_new_subset_length(tvb, offset, 6);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -1231,7 +1231,7 @@ static int dissect_batadv_batman_v11(tvbuff_t *tvb, int offset, packet_info *pin
tap_queue_packet(batadv_tap, pinfo, batman_packeth);
for (i = 0; i < batman_packeth->num_tt; i++) {
- next_tvb = tvb_new_subset(tvb, offset, 6, 6);
+ next_tvb = tvb_new_subset_length(tvb, offset, 6);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -1348,7 +1348,7 @@ static int dissect_batadv_batman_v14(tvbuff_t *tvb, int offset, packet_info *pin
tap_queue_packet(batadv_tap, pinfo, batman_packeth);
for (i = 0; i < batman_packeth->tt_num_changes; i++) {
- next_tvb = tvb_new_subset(tvb, offset, TT_ENTRY_V14_SIZE, TT_ENTRY_V14_SIZE);
+ next_tvb = tvb_new_subset_length(tvb, offset, TT_ENTRY_V14_SIZE);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -1360,7 +1360,7 @@ static int dissect_batadv_batman_v14(tvbuff_t *tvb, int offset, packet_info *pin
length_remaining = tvb_length_remaining(tvb, offset);
if (length_remaining > 0) {
- next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, tree);
}
@@ -1477,7 +1477,7 @@ static void dissect_batadv_bcast_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tre
length_remaining = tvb_length_remaining(tvb, offset);
if (length_remaining > 0) {
- next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
}
@@ -1545,7 +1545,7 @@ static void dissect_batadv_bcast_v10(tvbuff_t *tvb, packet_info *pinfo, proto_tr
length_remaining = tvb_length_remaining(tvb, offset);
if (length_remaining > 0) {
- next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -1618,7 +1618,7 @@ static void dissect_batadv_bcast_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tr
length_remaining = tvb_length_remaining(tvb, offset);
if (length_remaining > 0) {
- next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -1735,7 +1735,7 @@ static void dissect_batadv_icmp_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tree
length_remaining = tvb_length_remaining(tvb, offset);
if (length_remaining > 0) {
- next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, tree);
}
@@ -1850,7 +1850,7 @@ static void dissect_batadv_icmp_v7(tvbuff_t *tvb, packet_info *pinfo, proto_tree
length_remaining = tvb_length_remaining(tvb, offset);
if (length_remaining > 0) {
- next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, tree);
}
}
@@ -2031,7 +2031,7 @@ static void dissect_batadv_unicast_v6(tvbuff_t *tvb, packet_info *pinfo, proto_t
length_remaining = tvb_length_remaining(tvb, offset);
if (length_remaining > 0) {
- next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -2100,7 +2100,7 @@ static void dissect_batadv_unicast_v14(tvbuff_t *tvb, packet_info *pinfo, proto_
length_remaining = tvb_length_remaining(tvb, offset);
if (length_remaining > 0) {
- next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -2200,7 +2200,7 @@ static void dissect_batadv_unicast_4addr_v14(tvbuff_t *tvb, packet_info *pinfo,
length_remaining = tvb_length_remaining(tvb, offset);
if (length_remaining > 0) {
- next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -2578,7 +2578,7 @@ static void dissect_batadv_vis_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tree
}
for (i = 0; i < vis_packeth->entries; i++) {
- next_tvb = tvb_new_subset(tvb, offset, entry_size, entry_size);
+ next_tvb = tvb_new_subset_length(tvb, offset, entry_size);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -2603,7 +2603,7 @@ static void dissect_batadv_vis_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tree
length_remaining = tvb_length_remaining(tvb, offset);
if (length_remaining > 0) {
- next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -2695,7 +2695,7 @@ static void dissect_batadv_vis_v10(tvbuff_t *tvb, packet_info *pinfo, proto_tree
tap_queue_packet(batadv_tap, pinfo, vis_packeth);
for (i = 0; i < vis_packeth->entries; i++) {
- next_tvb = tvb_new_subset(tvb, offset, VIS_ENTRY_V8_SIZE, VIS_ENTRY_V8_SIZE);
+ next_tvb = tvb_new_subset_length(tvb, offset, VIS_ENTRY_V8_SIZE);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -2707,7 +2707,7 @@ static void dissect_batadv_vis_v10(tvbuff_t *tvb, packet_info *pinfo, proto_tree
length_remaining = tvb_length_remaining(tvb, offset);
if (length_remaining > 0) {
- next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -2803,7 +2803,7 @@ static void dissect_batadv_vis_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tree
tap_queue_packet(batadv_tap, pinfo, vis_packeth);
for (i = 0; i < vis_packeth->entries; i++) {
- next_tvb = tvb_new_subset(tvb, offset, VIS_ENTRY_V8_SIZE, VIS_ENTRY_V8_SIZE);
+ next_tvb = tvb_new_subset_length(tvb, offset, VIS_ENTRY_V8_SIZE);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -2815,7 +2815,7 @@ static void dissect_batadv_vis_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tree
length_remaining = tvb_length_remaining(tvb, offset);
if (length_remaining > 0) {
- next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -2998,7 +2998,7 @@ static void dissect_batadv_tt_query_v14(tvbuff_t *tvb, packet_info *pinfo _U_, p
if (tt_type == TT_RESPONSE) {
for (i = 0; i < tt_query_packeth->tt_data; i++) {
- next_tvb = tvb_new_subset(tvb, offset, TT_ENTRY_V14_SIZE, TT_ENTRY_V14_SIZE);
+ next_tvb = tvb_new_subset_length(tvb, offset, TT_ENTRY_V14_SIZE);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -3011,7 +3011,7 @@ static void dissect_batadv_tt_query_v14(tvbuff_t *tvb, packet_info *pinfo _U_, p
length_remaining = tvb_length_remaining(tvb, offset);
if (length_remaining > 0) {
- next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
@@ -3143,7 +3143,7 @@ static void dissect_batadv_roam_adv_v14(tvbuff_t *tvb, packet_info *pinfo, proto
length_remaining = tvb_length_remaining(tvb, offset);
if (length_remaining > 0) {
- next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (have_tap_listener(batadv_follow_tap)) {
tap_queue_packet(batadv_follow_tap, pinfo, next_tvb);
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index 7bf74a396b..2c25f881cf 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -669,7 +669,7 @@ printf("dissect_ber_tagged_type(%s) entered\n", name);
length_remaining = tvb_length_remaining(tvb, offset);
if (tmp_len > (guint32)length_remaining)
tmp_len = length_remaining;
- next_tvb = tvb_new_subset(tvb, offset, tmp_len, tmp_len);
+ next_tvb = tvb_new_subset_length(tvb, offset, tmp_len);
type(tag_impl, next_tvb, 0, actx, tree, hf_id);
offset += tmp_len;
} else {
@@ -1710,7 +1710,7 @@ printf("OCTET STRING dissect_ber_octet_string(%s) entered\n", name);
if (out_tvb) {
if (len > (guint32)length_remaining)
len = length_remaining;
- *out_tvb = tvb_new_subset(tvb, offset, len, len);
+ *out_tvb = tvb_new_subset_length(tvb, offset, len);
}
}
return end_offset;
@@ -2292,7 +2292,7 @@ ber_sequence_try_again:
/* dissect header and len for field */
if (ind_field && (len == 2)) {
/* This is a Zero length field */
- next_tvb = tvb_new_subset(tvb, offset, len, len);
+ next_tvb = tvb_new_subset_length(tvb, offset, len);
hoffset = eoffset;
} else {
hoffset = dissect_ber_identifier(actx->pinfo, tree, tvb, hoffset, NULL, NULL, NULL);
@@ -2300,13 +2300,13 @@ ber_sequence_try_again:
length_remaining = tvb_length_remaining(tvb, hoffset);
if (length_remaining > (eoffset - hoffset - (2 * ind_field)))
length_remaining = eoffset - hoffset - (2 * ind_field);
- next_tvb = tvb_new_subset(tvb, hoffset, length_remaining, length_remaining);
+ next_tvb = tvb_new_subset_length(tvb, hoffset, length_remaining);
}
} else {
length_remaining = tvb_length_remaining(tvb, hoffset);
if (length_remaining > (eoffset - hoffset))
length_remaining = eoffset - hoffset;
- next_tvb = tvb_new_subset(tvb, hoffset, length_remaining, length_remaining);
+ next_tvb = tvb_new_subset_length(tvb, hoffset, length_remaining);
}
#if 0
@@ -3161,7 +3161,7 @@ printf("OBJECT IDENTIFIER dissect_ber_any_oid(%s) entered\n", name);
}
if (value_tvb)
- *value_tvb = tvb_new_subset(tvb, offset, len, len);
+ *value_tvb = tvb_new_subset_length(tvb, offset, len);
return eoffset;
}
@@ -3428,7 +3428,7 @@ printf("SQ OF dissect_ber_sq_of(%s) entered\n", name);
length_remaining = tvb_length_remaining(tvb, hoffset);
if (length_remaining>eoffset-hoffset)
length_remaining = eoffset-hoffset;
- next_tvb = tvb_new_subset(tvb, hoffset, length_remaining, length_remaining);
+ next_tvb = tvb_new_subset_length(tvb, hoffset, length_remaining);
imp_tag = FALSE;
if (seq->flags == BER_FLAGS_IMPLTAG)
@@ -3841,7 +3841,7 @@ dissect_ber_constrained_bitstring(gboolean implicit_tag, asn1_ctx_t *actx, proto
}
if (out_tvb) {
if (len <= (guint32)tvb_length_remaining(tvb, offset)) {
- *out_tvb = tvb_new_subset(tvb, offset, len, len);
+ *out_tvb = tvb_new_subset_length(tvb, offset, len);
} else {
*out_tvb = tvb_new_subset_remaining(tvb, offset);
}
diff --git a/epan/dissectors/packet-bootp.c b/epan/dissectors/packet-bootp.c
index 72612d0925..328421dd51 100644
--- a/epan/dissectors/packet-bootp.c
+++ b/epan/dissectors/packet-bootp.c
@@ -2291,7 +2291,7 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, proto_item
/* Concatenate the block before being interpreted for managing RFC 3396 */
if (optlen)
- tvb_composite_append(rfc3396_dns_domain_search_list.tvb_composite, tvb_new_subset(tvb, optoff, optlen, optlen));
+ tvb_composite_append(rfc3396_dns_domain_search_list.tvb_composite, tvb_new_subset_length(tvb, optoff, optlen));
if (rfc3396_dns_domain_search_list.index_current_block == rfc3396_dns_domain_search_list.total_number_of_block
&& rfc3396_dns_domain_search_list.tvb_composite) {
@@ -2338,7 +2338,7 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, proto_item
/* Concatenate the block before being interpreted for managing RFC 3396 */
if (optlen)
- tvb_composite_append(rfc3396_sip_server.tvb_composite, tvb_new_subset(tvb, optoff, optlen, optlen));
+ tvb_composite_append(rfc3396_sip_server.tvb_composite, tvb_new_subset_length(tvb, optoff, optlen));
if (rfc3396_sip_server.index_current_block == rfc3396_sip_server.total_number_of_block
&& rfc3396_sip_server.tvb_composite) {
diff --git a/epan/dissectors/packet-bssap.c b/epan/dissectors/packet-bssap.c
index e7ee98eb19..e309bf7ff3 100644
--- a/epan/dissectors/packet-bssap.c
+++ b/epan/dissectors/packet-bssap.c
@@ -480,7 +480,7 @@ dissect_bssap_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bssap_tre
{
tvbuff_t *parameter_tvb;
- parameter_tvb = tvb_new_subset(tvb, offset, parameter_length, parameter_length);
+ parameter_tvb = tvb_new_subset_length(tvb, offset, parameter_length);
switch (parameter_type)
{
@@ -811,7 +811,7 @@ dissect_bssap_dlink_tunnel_payload_control_and_info(tvbuff_t *tvb, packet_info *
*/
proto_tree_add_item(ie_tree, hf_bssap_tunnel_prio, tvb, offset, 1, ENC_BIG_ENDIAN);
/* Tunnel payload */
- next_tvb = tvb_new_subset(tvb, offset, ie_len-4, ie_len-4);
+ next_tvb = tvb_new_subset_length(tvb, offset, ie_len-4);
if ((prot_disc == 2)&&(rrlp_handle))
call_dissector(rrlp_handle, next_tvb, pinfo, ie_tree);
@@ -986,7 +986,7 @@ dissect_bssap_imei(tvbuff_t *tvb, proto_tree *tree, int offset)
/* The IMEI is coded as a sequence of BCD digits, compressed two into each octet.
* The IMEI consists of 15 digits (see 3GPP TS 23.003).
*/
- ie_tvb = tvb_new_subset(tvb, offset, ie_len, ie_len);
+ ie_tvb = tvb_new_subset_length(tvb, offset, ie_len);
digit_str = unpack_digits(ie_tvb, 0, &Dgt1_9_bcd, FALSE);
proto_tree_add_string(ie_tree, hf_bssap_imei, ie_tvb, 0, -1, digit_str);
@@ -1014,7 +1014,7 @@ dissect_bssap_imesiv(tvbuff_t *tvb, proto_tree *tree, int offset)
/* The IMEISV is coded as a sequence of BCD digits, compressed two into each octet.
* The IMEISV consists of 16 digits (see 3GPP TS 23.003).
*/
- ie_tvb = tvb_new_subset(tvb, offset, ie_len, ie_len);
+ ie_tvb = tvb_new_subset_length(tvb, offset, ie_len);
digit_str = unpack_digits(ie_tvb, 0, &Dgt1_9_bcd, FALSE);
proto_tree_add_string(ie_tree, hf_bssap_imeisv, ie_tvb, 0, -1, digit_str);
@@ -1045,7 +1045,7 @@ dissect_bssap_imsi(tvbuff_t *tvb, proto_tree *tree, int offset)
offset++;
proto_tree_add_item(ie_tree, hf_bssap_plus_ie_len, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
- ie_tvb = tvb_new_subset(tvb, offset, ie_len, ie_len);
+ ie_tvb = tvb_new_subset_length(tvb, offset, ie_len);
digit_str = unpack_digits(ie_tvb, 0, &Dgt1_9_bcd, TRUE);
proto_tree_add_string(ie_tree, hf_bssap_imsi, ie_tvb, 0, -1, digit_str);
@@ -1423,7 +1423,7 @@ dissect_bssap_sgsn_number(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_tree_add_item(ie_tree, hf_bssap_type_of_number, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ie_tree, hf_bssap_numbering_plan_id, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
- number_tvb = tvb_new_subset(tvb, offset, ie_len-1, ie_len-1);
+ number_tvb = tvb_new_subset_length(tvb, offset, ie_len-1);
digit_str = unpack_digits(number_tvb, 0, &Dgt1_9_bcd, FALSE);
proto_tree_add_string(ie_tree, hf_bssap_sgsn_number, number_tvb, 0, -1, digit_str);
@@ -1535,7 +1535,7 @@ dissect_bssap_ulink_tunnel_payload_control_and_info(tvbuff_t *tvb, packet_info *
*/
proto_tree_add_item(ie_tree, hf_bssap_tunnel_prio, tvb, offset, 1, ENC_BIG_ENDIAN);
/* Tunnel payload */
- next_tvb = tvb_new_subset(tvb, offset, ie_len - 4, ie_len - 4);
+ next_tvb = tvb_new_subset_length(tvb, offset, ie_len - 4);
if ((prot_disc == 2)&&(rrlp_handle))
call_dissector(rrlp_handle, next_tvb, pinfo, ie_tree);
@@ -1575,7 +1575,7 @@ dissect_bssap_vlr_number(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_tree_add_item(ie_tree, hf_bssap_type_of_number, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ie_tree, hf_bssap_numbering_plan_id, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
- number_tvb = tvb_new_subset(tvb, offset, ie_len - 1, ie_len - 1);
+ number_tvb = tvb_new_subset_length(tvb, offset, ie_len - 1);
digit_str = unpack_digits(number_tvb, 0, &Dgt1_9_bcd, FALSE);
proto_tree_add_string(ie_tree, hf_bssap_sgsn_number, number_tvb, 0, -1, digit_str);
diff --git a/epan/dissectors/packet-bssgp.c b/epan/dissectors/packet-bssgp.c
index e5d9fa1f0e..9483e2d684 100644
--- a/epan/dissectors/packet-bssgp.c
+++ b/epan/dissectors/packet-bssgp.c
@@ -913,7 +913,7 @@ de_bssgp_llc_pdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of
curr_offset = offset;
if(len > 0){
- next_tvb = tvb_new_subset(tvb, curr_offset, len, len);
+ next_tvb = tvb_new_subset_length(tvb, curr_offset, len);
proto_tree_add_text(tree, tvb, curr_offset, len, "LLC Data");
}
@@ -2316,7 +2316,7 @@ de_bssgp_mbms_session_dur(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, g
curr_offset = offset;
/* AVP Code: 904 MBMS-Session-Duration Registered by packet-gtp.c */
- new_tvb =tvb_new_subset(tvb, offset, len, len);
+ new_tvb =tvb_new_subset_length(tvb, offset, len);
dissector_try_uint(diameter_3gpp_avp_dissector_table, 904, new_tvb, pinfo, tree);
return(curr_offset-offset);
@@ -2337,7 +2337,7 @@ de_bssgp_mbms_sai_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guin
curr_offset = offset;
/* AVP Code: 903 MBMS-Service-Area Registered by packet-gtp.c */
- new_tvb =tvb_new_subset(tvb, offset, len, len);
+ new_tvb =tvb_new_subset_length(tvb, offset, len);
dissector_try_uint(diameter_3gpp_avp_dissector_table, 903, new_tvb, pinfo, tree);
return(curr_offset-offset);
@@ -3196,7 +3196,7 @@ de_bssgp_son_transfer_app_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo
* as defined in 3GPP TS 36.413
*/
if(len > 0){
- next_tvb = tvb_new_subset(tvb, offset, len, len);
+ next_tvb = tvb_new_subset_length(tvb, offset, len);
dissect_s1ap_SONtransferApplicationIdentity_PDU(next_tvb, pinfo, tree, NULL);
}
diff --git a/epan/dissectors/packet-btavctp.c b/epan/dissectors/packet-btavctp.c
index 18740de817..50c468673c 100644
--- a/epan/dissectors/packet-btavctp.c
+++ b/epan/dissectors/packet-btavctp.c
@@ -215,7 +215,7 @@ dissect_btavctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
length = tvb_ensure_length_remaining(tvb, offset);
/* reassembling */
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
if (packet_type == PACKET_TYPE_SINGLE) {
if (!dissector_try_uint_new(avctp_service_dissector_table, pid, next_tvb, pinfo, tree, TRUE, avctp_data)) {
call_dissector(data_handle, next_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-bthci_cmd.c b/epan/dissectors/packet-bthci_cmd.c
index dce7d26ef7..6a8655122d 100644
--- a/epan/dissectors/packet-bthci_cmd.c
+++ b/epan/dissectors/packet-bthci_cmd.c
@@ -2473,7 +2473,7 @@ dissect_host_controller_baseband_cmd(tvbuff_t *tvb, int offset, packet_info *pin
offset++;
switch (filter_condition_type) {
case 0x01:
- call_dissector(btcommon_cod_handle, tvb_new_subset(tvb, offset, 3, 3), pinfo, tree);
+ call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, tree);
offset += 3;
offset=dissect_bthci_cmd_cod_mask(tvb, offset, pinfo, tree);
@@ -2501,7 +2501,7 @@ dissect_host_controller_baseband_cmd(tvbuff_t *tvb, int offset, packet_info *pin
break;
case 0x01:
- call_dissector(btcommon_cod_handle, tvb_new_subset(tvb, offset, 3, 3), pinfo, tree);
+ call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, tree);
offset += 3;
offset=dissect_bthci_cmd_cod_mask(tvb, offset, pinfo, tree);
@@ -2631,7 +2631,7 @@ dissect_host_controller_baseband_cmd(tvbuff_t *tvb, int offset, packet_info *pin
break;
case 0x0024: /* Write Class of Device */
- call_dissector(btcommon_cod_handle, tvb_new_subset(tvb, offset, 3, 3), pinfo, tree);
+ call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, tree);
offset += 3;
break;
@@ -2812,7 +2812,7 @@ dissect_host_controller_baseband_cmd(tvbuff_t *tvb, int offset, packet_info *pin
proto_tree_add_item(tree, hf_bthci_cmd_fec_required, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
- call_dissector(btcommon_eir_handle, tvb_new_subset(tvb, offset, 240, 240), pinfo, tree);
+ call_dissector(btcommon_eir_handle, tvb_new_subset_length(tvb, offset, 240), pinfo, tree);
save_local_device_name(tvb, offset, pinfo, 240, hci_data);
offset += 240;
break;
@@ -3155,7 +3155,7 @@ dissect_le_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(tree, hf_bthci_cmd_le_data_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
- call_dissector(btcommon_ad_handle, tvb_new_subset(tvb, offset, 31, 31), pinfo, tree);
+ call_dissector(btcommon_ad_handle, tvb_new_subset_length(tvb, offset, 31), pinfo, tree);
save_local_device_name(tvb, offset, pinfo, 31, hci_data);
offset += 31;
break;
@@ -3255,7 +3255,7 @@ dissect_le_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
sub_item = proto_tree_add_item(tree, hf_bthci_cmd_le_channel_map, tvb, offset, 5, ENC_NA);
sub_tree = proto_item_add_subtree(sub_item, ett_le_channel_map);
- call_dissector(btcommon_le_channel_map_handle, tvb_new_subset(tvb, offset, 5, 5), pinfo, sub_tree);
+ call_dissector(btcommon_le_channel_map_handle, tvb_new_subset_length(tvb, offset, 5), pinfo, sub_tree);
offset += 5;
break;
@@ -5126,7 +5126,7 @@ dissect_eir_ad_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
case 0x0D: /* Class Of Device */
- call_dissector(btcommon_cod_handle, tvb_new_subset(tvb, offset, 3, 3), pinfo, entry_tree);
+ call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, entry_tree);
offset += 3;
break;
diff --git a/epan/dissectors/packet-bthci_evt.c b/epan/dissectors/packet-bthci_evt.c
index e381b7f6f1..3b78a5ea13 100644
--- a/epan/dissectors/packet-bthci_evt.c
+++ b/epan/dissectors/packet-bthci_evt.c
@@ -1032,7 +1032,7 @@ dissect_bthci_evt_conn_request(tvbuff_t *tvb, int offset, packet_info *pinfo, pr
{
offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
- call_dissector(btcommon_cod_handle, tvb_new_subset(tvb, offset, 3, 3), pinfo, tree);
+ call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, tree);
offset += 3;
proto_tree_add_item(tree, hf_bthci_evt_link_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
@@ -1619,7 +1619,7 @@ dissect_bthci_evt_inq_result_with_rssi(tvbuff_t *tvb, int offset,
/* reserved byte */
offset += 1;
- call_dissector(btcommon_cod_handle, tvb_new_subset(tvb, offset, 3, 3), pinfo, tree);
+ call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, tree);
offset += 3;
proto_tree_add_item(tree, hf_bthci_evt_clock_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
@@ -1783,7 +1783,7 @@ dissect_bthci_evt_le_meta(tvbuff_t *tvb, int offset, packet_info *pinfo,
offset += 1;
if (length > 0) {
- call_dissector(btcommon_ad_handle, tvb_new_subset(tvb, offset, length, length), pinfo, tree);
+ call_dissector(btcommon_ad_handle, tvb_new_subset_length(tvb, offset, length), pinfo, tree);
save_remote_device_name(tvb, offset, pinfo, length, bd_addr, hci_data);
offset += length;
}
@@ -2390,7 +2390,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
- call_dissector(btcommon_cod_handle, tvb_new_subset(tvb, offset, 3, 3), pinfo, tree);
+ call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, tree);
offset += 3;
break;
@@ -2521,7 +2521,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
proto_tree_add_item(tree, hf_bthci_evt_fec_required, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
- call_dissector(btcommon_eir_handle, tvb_new_subset(tvb, offset, 240, 240), pinfo, tree);
+ call_dissector(btcommon_eir_handle, tvb_new_subset_length(tvb, offset, 240), pinfo, tree);
offset += 240;
break;
@@ -2895,7 +2895,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
sub_item = proto_tree_add_item(tree, hf_bthci_evt_le_channel_map, tvb, offset, 5, ENC_NA);
sub_tree = proto_item_add_subtree(sub_item, ett_le_channel_map);
- call_dissector(btcommon_le_channel_map_handle, tvb_new_subset(tvb, offset, 5, 5), pinfo, sub_tree);
+ call_dissector(btcommon_le_channel_map_handle, tvb_new_subset_length(tvb, offset, 5), pinfo, sub_tree);
offset += 5;
break;
}
@@ -3302,7 +3302,7 @@ dissect_bthci_evt_inq_result(tvbuff_t *tvb, int offset, packet_info *pinfo, prot
proto_tree_add_item(tree, hf_bthci_evt_page_scan_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
- call_dissector(btcommon_cod_handle, tvb_new_subset(tvb, offset, 3, 3), pinfo, tree);
+ call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, tree);
offset += 3;
proto_tree_add_item(tree, hf_bthci_evt_clock_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
@@ -3519,7 +3519,7 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
case 0x2f: /* Extended Inquiry Result */
offset = dissect_bthci_evt_inq_result_with_rssi(tvb, offset, pinfo, bthci_evt_tree, bd_addr);
- call_dissector(btcommon_eir_handle, tvb_new_subset(tvb, offset, 240, 240), pinfo, bthci_evt_tree);
+ call_dissector(btcommon_eir_handle, tvb_new_subset_length(tvb, offset, 240), pinfo, bthci_evt_tree);
save_remote_device_name(tvb, offset, pinfo, 240, bd_addr, hci_data);
offset += 240;
diff --git a/epan/dissectors/packet-btle.c b/epan/dissectors/packet-btle.c
index 2a534e27f2..0fc82e1b1d 100644
--- a/epan/dissectors/packet-btle.c
+++ b/epan/dissectors/packet-btle.c
@@ -408,7 +408,7 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
offset = dissect_bd_addr(hf_advertising_address, btle_tree, tvb, offset);
if (tvb_length_remaining(tvb, offset) > 3) {
- next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset) - 3, tvb_length_remaining(tvb, offset) - 3);
+ next_tvb = tvb_new_subset_length(tvb, offset, tvb_length_remaining(tvb, offset) - 3);
call_dissector(btcommon_ad_handle, next_tvb, pinfo, btle_tree);
}
@@ -432,7 +432,7 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
sub_tree = proto_item_add_subtree(sub_item, ett_scan_response_data);
if (tvb_length_remaining(tvb, offset) > 3) {
- next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset) - 3, tvb_length_remaining(tvb, offset) - 3);
+ next_tvb = tvb_new_subset_length(tvb, offset, tvb_length_remaining(tvb, offset) - 3);
call_dissector(btcommon_ad_handle, next_tvb, pinfo, sub_tree);
}
@@ -470,7 +470,7 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
sub_item = proto_tree_add_item(link_layer_data_tree, hf_link_layer_data_channel_map, tvb, offset, 5, ENC_NA);
sub_tree = proto_item_add_subtree(sub_item, ett_channel_map);
- call_dissector(btcommon_le_channel_map_handle, tvb_new_subset(tvb, offset, 5, 5), pinfo, sub_tree);
+ call_dissector(btcommon_le_channel_map_handle, tvb_new_subset_length(tvb, offset, 5), pinfo, sub_tree);
offset += 5;
proto_tree_add_item(link_layer_data_tree, hf_link_layer_data_hop, tvb, offset, 1, ENC_LITTLE_ENDIAN);
@@ -537,7 +537,7 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
acl_data->remote_bd_addr_oui = 0;
acl_data->remote_bd_addr_id = 0;
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector_with_data(btl2cap_handle, next_tvb, pinfo, tree, acl_data);
offset += length;
}
@@ -588,7 +588,7 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
sub_item = proto_tree_add_item(btle_tree, hf_control_channel_map, tvb, offset, 5, ENC_NA);
sub_tree = proto_item_add_subtree(sub_item, ett_channel_map);
- call_dissector(btcommon_le_channel_map_handle, tvb_new_subset(tvb, offset, 5, 5), pinfo, sub_tree);
+ call_dissector(btcommon_le_channel_map_handle, tvb_new_subset_length(tvb, offset, 5), pinfo, sub_tree);
offset += 5;
proto_tree_add_item(btle_tree, hf_control_instant, tvb, offset, 2, ENC_LITTLE_ENDIAN);
diff --git a/epan/dissectors/packet-btrfcomm.c b/epan/dissectors/packet-btrfcomm.c
index a97d2f1809..d8fc59ffab 100644
--- a/epan/dissectors/packet-btrfcomm.c
+++ b/epan/dissectors/packet-btrfcomm.c
@@ -859,7 +859,7 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
tvbuff_t *next_tvb;
btrfcomm_data_t *rfcomm_data;
- next_tvb = tvb_new_subset(tvb, offset, frame_len, frame_len);
+ next_tvb = tvb_new_subset_length(tvb, offset, frame_len);
rfcomm_data = (btrfcomm_data_t *) wmem_new(wmem_packet_scope(), btrfcomm_data_t);
rfcomm_data->interface_id = l2cap_data->interface_id;
diff --git a/epan/dissectors/packet-btsap.c b/epan/dissectors/packet-btsap.c
index 36a102e11a..8d3f901466 100644
--- a/epan/dissectors/packet-btsap.c
+++ b/epan/dissectors/packet-btsap.c
@@ -256,7 +256,7 @@ dissect_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree,
case 0x04: /* CommandAPDU */
/* GSM 11.11 */
if (gsm_sim_cmd_handle && top_dissect != TOP_DISSECT_OFF) {
- next_tvb = tvb_new_subset(tvb, offset, parameter_length, parameter_length);
+ next_tvb = tvb_new_subset_length(tvb, offset, parameter_length);
col_append_str(pinfo->cinfo, COL_INFO, ": ");
if (top_dissect == TOP_DISSECT_INTERNAL) {
@@ -275,7 +275,7 @@ dissect_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree,
case 0x05: /* ResponseAPDU */
/* GSM 11.11 or ISO/IEC 7816-4; depend of TRANSFER_APDU_REQ */
if (gsm_sim_resp_handle && top_dissect != TOP_DISSECT_OFF) {
- next_tvb = tvb_new_subset(tvb, offset, parameter_length, parameter_length);
+ next_tvb = tvb_new_subset_length(tvb, offset, parameter_length);
col_append_str(pinfo->cinfo, COL_INFO, ": ");
if (top_dissect == TOP_DISSECT_INTERNAL) {
@@ -294,7 +294,7 @@ dissect_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree,
case 0x06: /* ATR */
/* ISO/IEC 7816-3 */
if (iso7816_atr_handle && top_dissect != TOP_DISSECT_OFF) {
- next_tvb = tvb_new_subset(tvb, offset, parameter_length, parameter_length);
+ next_tvb = tvb_new_subset_length(tvb, offset, parameter_length);
col_append_str(pinfo->cinfo, COL_INFO, ": ");
if (top_dissect == TOP_DISSECT_INTERNAL) {
@@ -340,7 +340,7 @@ dissect_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree,
case 0x10: /* CommandAPDU7816 */
/* ISO/IEC 7816-4 */
if (gsm_sim_cmd_handle && top_dissect != TOP_DISSECT_OFF) {
- next_tvb = tvb_new_subset(tvb, offset, parameter_length, parameter_length);
+ next_tvb = tvb_new_subset_length(tvb, offset, parameter_length);
col_append_str(pinfo->cinfo, COL_INFO, ": ");
if (top_dissect == TOP_DISSECT_INTERNAL) {
diff --git a/epan/dissectors/packet-bzr.c b/epan/dissectors/packet-bzr.c
index 80a802fce3..e014639e1c 100644
--- a/epan/dissectors/packet-bzr.c
+++ b/epan/dissectors/packet-bzr.c
@@ -247,7 +247,7 @@ dissect_bzr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pdu_len = tvb_reported_length_remaining(tvb, offset);
}
}
- next_tvb = tvb_new_subset(tvb, offset, pdu_len, pdu_len);
+ next_tvb = tvb_new_subset_length(tvb, offset, pdu_len);
dissect_bzr_pdu(next_tvb, pinfo, tree);
offset += pdu_len;
}
diff --git a/epan/dissectors/packet-catapult-dct2000.c b/epan/dissectors/packet-catapult-dct2000.c
index 2fa25b754e..bd577093c9 100644
--- a/epan/dissectors/packet-catapult-dct2000.c
+++ b/epan/dissectors/packet-catapult-dct2000.c
@@ -1090,7 +1090,7 @@ static void dissect_ccpri_lte(tvbuff_t *tvb, gint offset,
set to call cpri C&M dissector instead of X.25) */
protocol_handle = find_dissector("lapb");
if ((protocol_handle != NULL) && (tvb_length_remaining(tvb, offset) > 0)) {
- ccpri_tvb = tvb_new_subset(tvb, offset, length, length);
+ ccpri_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector_only(protocol_handle, ccpri_tvb, pinfo, tree, NULL);
}
}
diff --git a/epan/dissectors/packet-cell_broadcast.c b/epan/dissectors/packet-cell_broadcast.c
index 5a6896e24d..7834b33b59 100644
--- a/epan/dissectors/packet-cell_broadcast.c
+++ b/epan/dissectors/packet-cell_broadcast.c
@@ -350,7 +350,7 @@ dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (text_len)
{
- cbs_page_tvb = tvb_new_subset(cbs_page_tvb, 0, text_len, text_len);
+ cbs_page_tvb = tvb_new_subset_length(cbs_page_tvb, 0, text_len);
if (total_pages == 1)
{
/* no need for reassembly */
diff --git a/epan/dissectors/packet-cip.c b/epan/dissectors/packet-cip.c
index c1b29232eb..303ef7dce1 100644
--- a/epan/dissectors/packet-cip.c
+++ b/epan/dissectors/packet-cip.c
@@ -4357,7 +4357,7 @@ dissect_cip_multiple_service_packet_req(tvbuff_t *tvb, packet_info *pinfo, proto
col_append_str( pinfo->cinfo, COL_INFO, ", ");
- next_tvb = tvb_new_subset(tvb, offset+serv_offset, serv_length, serv_length);
+ next_tvb = tvb_new_subset_length(tvb, offset+serv_offset, serv_length);
if ( mr_mult_req_info )
{
@@ -4676,7 +4676,7 @@ dissect_cip_multiple_service_packet_rsp(tvbuff_t *tvb, packet_info *pinfo, proto
col_append_str( pinfo->cinfo, COL_INFO, ", ");
- next_tvb = tvb_new_subset(tvb, offset+serv_offset, serv_length, serv_length);
+ next_tvb = tvb_new_subset_length(tvb, offset+serv_offset, serv_length);
if ( mr_mult_req_info )
{
mr_single_req_info = mr_mult_req_info->requests + i;
@@ -5127,7 +5127,7 @@ dissect_cip_cm_data( proto_tree *item_tree, tvbuff_t *tvb, int offset, int item_
p_add_proto_data(wmem_file_scope(), pinfo, proto_cip, 0, pembedded_req_info );
proto_tree_add_text( item_tree, NULL, 0, 0, "(Service: Unconnected Send (Response))" );
- next_tvb = tvb_new_subset(tvb, offset, item_length, item_length);
+ next_tvb = tvb_new_subset_length(tvb, offset, item_length);
if ( pembedded_req_info && pembedded_req_info->dissector )
call_dissector(pembedded_req_info->dissector, next_tvb, pinfo, item_tree );
else
@@ -5432,7 +5432,7 @@ dissect_cip_cm_data( proto_tree *item_tree, tvbuff_t *tvb, int offset, int item_
col_append_str( pinfo->cinfo, COL_INFO, ": ");
- next_tvb = tvb_new_subset(tvb, offset+2+req_path_size+4, msg_req_siz, msg_req_siz);
+ next_tvb = tvb_new_subset_length(tvb, offset+2+req_path_size+4, msg_req_siz);
preq_info = (cip_req_info_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_cip, 0 );
pembedded_req_info = NULL;
if ( preq_info )
@@ -5592,7 +5592,7 @@ dissect_cip_mb_data( proto_tree *item_tree, tvbuff_t *tvb, int offset, int item_
if( tvb_length_remaining(tvb, offset) > 0 )
{
/* dissect the Modbus PDU */
- next_tvb = tvb_new_subset( tvb, offset+4+add_stat_size, item_length-4-add_stat_size, item_length-4-add_stat_size);
+ next_tvb = tvb_new_subset_length( tvb, offset+4+add_stat_size, item_length-4-add_stat_size);
/* keep packet context */
request_info = wmem_new(wmem_packet_scope(), modbus_request_info_t);
@@ -5682,7 +5682,7 @@ dissect_cip_mb_data( proto_tree *item_tree, tvbuff_t *tvb, int offset, int item_
if( tvb_length_remaining(tvb, offset) > 0 )
{
/* dissect the Modbus PDU */
- next_tvb = tvb_new_subset( tvb, offset+2+req_path_size, item_length-req_path_size-2, item_length-req_path_size-2);
+ next_tvb = tvb_new_subset_length( tvb, offset+2+req_path_size, item_length-req_path_size-2);
/* keep packet context */
request_info = wmem_new(wmem_packet_scope(), modbus_request_info_t);
diff --git a/epan/dissectors/packet-cisco-sm.c b/epan/dissectors/packet-cisco-sm.c
index bfe61c9d5c..9c98bd900e 100644
--- a/epan/dissectors/packet-cisco-sm.c
+++ b/epan/dissectors/packet-cisco-sm.c
@@ -322,7 +322,7 @@ dissect_sm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item_set_len(ti, 16);
if (length > 0) {
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
if ((msg_type == PDU_MTP3_TO_SLT || msg_type == PDU_MTP3_FROM_SLT)) {
call_dissector(q931_handle, next_tvb, pinfo, tree);
@@ -346,7 +346,7 @@ dissect_sm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* This should be the EISUP dissector but we havent got one
* right now - so decode it as data for now ... */
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector(data_handle, next_tvb, pinfo, sm_tree);
break;
@@ -381,7 +381,7 @@ dissect_sm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(sm_tree, hf_sm_len, tvb, offset, 2, ENC_BIG_ENDIAN);
length = tvb_get_ntohs(tvb,offset);
offset = offset +2;
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector(sdp_handle, next_tvb, pinfo, sm_tree);
/*offset = offset+length;*/
@@ -413,7 +413,7 @@ dissect_sm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(sm_tree, hf_sm_len, tvb, offset, 2, ENC_BIG_ENDIAN);
length = tvb_get_ntohs(tvb,offset);
offset = offset +2;
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector(sdp_handle, next_tvb, pinfo, sm_tree);
/*offset = offset+length;*/
@@ -438,7 +438,7 @@ dissect_sm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item_set_len(ti, 16);
if (length > 0) {
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
switch (msg_type) {
case PDU_MTP3_TO_SLT:
diff --git a/epan/dissectors/packet-cisco-wids.c b/epan/dissectors/packet-cisco-wids.c
index fe98b2b074..1c4268c675 100644
--- a/epan/dissectors/packet-cisco-wids.c
+++ b/epan/dissectors/packet-cisco-wids.c
@@ -103,7 +103,7 @@ dissect_cwids(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(cwids_tree, hf_cwids_unknown3, tvb, offset, 8, ENC_NA);
offset += 8;
- wlan_tvb = tvb_new_subset(tvb, offset, capturelen, capturelen);
+ wlan_tvb = tvb_new_subset_length(tvb, offset, capturelen);
/* Continue after ieee80211 dissection errors */
pd_save = pinfo->private_data;
TRY {
@@ -118,12 +118,12 @@ dissect_cwids(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pinfo->private_data = pd_save;
#if 0
- wlan_tvb = tvb_new_subset(tvb, offset, capturelen, capturelen);
+ wlan_tvb = tvb_new_subset_length(tvb, offset, capturelen);
/* FIXME: Why does this throw an exception? */
proto_tree_add_text(cwids_tree, wlan_tvb, offset, capturelen,
"[Malformed or short IEEE80211 subpacket]");
#else
- tvb_new_subset(tvb, offset, capturelen, capturelen);
+ tvb_new_subset_length(tvb, offset, capturelen);
#endif
;
} ENDTRY;
diff --git a/epan/dissectors/packet-coap.c b/epan/dissectors/packet-coap.c
index 0ad8eeaa2e..359b2fe599 100644
--- a/epan/dissectors/packet-coap.c
+++ b/epan/dissectors/packet-coap.c
@@ -881,7 +881,7 @@ dissect_coap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
payload_tree = proto_item_add_subtree(payload_item, ett_coap_payload);
proto_tree_add_string(payload_tree, hf_coap_payload_desc, tvb, offset, -1, coap_ctype_str);
- payload_tvb = tvb_new_subset(tvb, offset, payload_length, payload_length);
+ payload_tvb = tvb_new_subset_length(tvb, offset, payload_length);
if (coap_ctype_value == DEFAULT_COAP_CTYPE_VALUE || coap_ctype_value == 0) {
coap_ctype_str_dis = "text/plain";
diff --git a/epan/dissectors/packet-cpfi.c b/epan/dissectors/packet-cpfi.c
index c35306795a..9099beb9ae 100644
--- a/epan/dissectors/packet-cpfi.c
+++ b/epan/dissectors/packet-cpfi.c
@@ -368,7 +368,7 @@ dissect_cpfi(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, void *
/* dissect the message */
/* extract and process the header */
- header_tvb = tvb_new_subset(message_tvb, 0, 8, 8);
+ header_tvb = tvb_new_subset_length(message_tvb, 0, 8);
dissect_cpfi_header(header_tvb, pinfo, cpfi_tree);
body_tvb = tvb_new_subset(message_tvb, 8, body_length, reported_body_length);
diff --git a/epan/dissectors/packet-daap.c b/epan/dissectors/packet-daap.c
index 84d965ff9b..f449ee9d8d 100644
--- a/epan/dissectors/packet-daap.c
+++ b/epan/dissectors/packet-daap.c
@@ -491,7 +491,7 @@ dissect_daap_one_tag(proto_tree *tree, tvbuff_t *tvb)
case dacp_cmst:
/* Container tags */
new_tree = proto_item_add_subtree(ti, ett_daap_sub);
- new_tvb = tvb_new_subset(tvb, offset, len, len); /* Use a new tvb so bounds checking */
+ new_tvb = tvb_new_subset_length(tvb, offset, len); /* Use a new tvb so bounds checking */
/* works Ok when dissecting container. */
/* Note: len is within tvb; checked above. */
/* len (see above) is used so that we'll */
diff --git a/epan/dissectors/packet-db-lsp.c b/epan/dissectors/packet-db-lsp.c
index 0a3c55b9dd..79b3f339ab 100644
--- a/epan/dissectors/packet-db-lsp.c
+++ b/epan/dissectors/packet-db-lsp.c
@@ -123,7 +123,7 @@ dissect_db_lsp_pdu (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
if (opvalue == OP_CERT) {
/* X509 Certificate */
- tvbuff_t *cert_tvb = tvb_new_subset (tvb, offset+10, length-10, length-10);
+ tvbuff_t *cert_tvb = tvb_new_subset_length (tvb, offset+10, length-10);
dissect_x509af_Certificate_PDU (cert_tvb, pinfo, db_lsp_tree);
} else {
proto_tree_add_item (db_lsp_tree, hf_value, tvb, offset, length, ENC_NA);
diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c
index 2254d987dc..b73856950f 100644
--- a/epan/dissectors/packet-diameter.c
+++ b/epan/dissectors/packet-diameter.c
@@ -618,7 +618,7 @@ dissect_diameter_avp(diam_ctx_t *c, tvbuff_t *tvb, int offset, diam_sub_dis_t *d
diam_sub_dis_inf->vendor_id = tvb_get_ntohl(tvb,offset);
}
- subtvb = tvb_new_subset(tvb,offset,len-(8+(vendor_flag?4:0)),len-(8+(vendor_flag?4:0)));
+ subtvb = tvb_new_subset_length(tvb,offset,len-(8+(vendor_flag?4:0)));
offset += len-(8+(vendor_flag?4:0));
save_tree = c->tree;
diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c
index 8717cad6a8..e685c37842 100644
--- a/epan/dissectors/packet-dmp.c
+++ b/epan/dissectors/packet-dmp.c
@@ -2084,7 +2084,7 @@ static gint dissect_dmp_ext_addr (tvbuff_t *tvb, packet_info *pinfo,
}
if (type == ASN1_BER) {
- tvbuff_t *next_tvb = tvb_new_subset(tvb, offset, length, length);
+ tvbuff_t *next_tvb = tvb_new_subset_length(tvb, offset, length);
dissect_p1_ORName (FALSE, next_tvb, 0, &asn1_ctx, ext_tree,
hf_addr_ext_asn1_ber);
diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c
index 1574b11bc6..82c9c8554e 100644
--- a/epan/dissectors/packet-dns.c
+++ b/epan/dissectors/packet-dns.c
@@ -3261,8 +3261,8 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
* the SMB dissector does in some cases, and check
* whether the security blob begins with "NTLMSSP".
*/
- gssapi_tvb = tvb_new_subset(
- tvb, cur_offset, tkey_keylen, tkey_keylen);
+ gssapi_tvb = tvb_new_subset_length(
+ tvb, cur_offset, tkey_keylen);
if (tvb_strneql(gssapi_tvb, 0, "NTLMSSP", 7) == 0) {
call_dissector(ntlmssp_handle, gssapi_tvb, pinfo, key_tree);
} else {
@@ -3326,7 +3326,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
mac_item = proto_tree_add_item(rr_tree, hf_dns_tsig_mac, tvb, cur_offset, tsig_siglen, ENC_NA);
mac_tree = proto_item_add_subtree(mac_item, ett_dns_mac);
- sub_tvb=tvb_new_subset(tvb, cur_offset, tsig_siglen, tsig_siglen);
+ sub_tvb=tvb_new_subset_length(tvb, cur_offset, tsig_siglen);
if (!dissector_try_string(dns_tsig_dissector_table, tsig_algname, sub_tvb, pinfo, mac_tree, NULL)) {
expert_add_info_format(pinfo, mac_item, &ei_dns_tsig_alg,
diff --git a/epan/dissectors/packet-dpnss-link.c b/epan/dissectors/packet-dpnss-link.c
index 31c29c3e12..a73293f11c 100644
--- a/epan/dissectors/packet-dpnss-link.c
+++ b/epan/dissectors/packet-dpnss-link.c
@@ -142,8 +142,7 @@ dissect_dpnss_link(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case FRAME_TYPE_UI_EVEN:
case FRAME_TYPE_UI_ODD:
protocol_data_length=tvb_length(tvb)-LINK_HEADER_SIZE;
- protocol_data_tvb=tvb_new_subset(tvb, LINK_HEADER_SIZE,
- protocol_data_length,
+ protocol_data_tvb=tvb_new_subset_length(tvb, LINK_HEADER_SIZE,
protocol_data_length);
if (dpnss_handle && protocol_data_length>0) {
call_dissector(dpnss_handle, protocol_data_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-drda.c b/epan/dissectors/packet-drda.c
index c64c743c8d..c82565c771 100644
--- a/epan/dissectors/packet-drda.c
+++ b/epan/dissectors/packet-drda.c
@@ -766,7 +766,7 @@ dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
{
/* Extract SQL statement from packet */
tvbuff_t* next_tvb = NULL;
- next_tvb = tvb_new_subset(tvb, offset + 4, iLengthParam - 4, iLengthParam - 4);
+ next_tvb = tvb_new_subset_length(tvb, offset + 4, iLengthParam - 4);
add_new_data_source(pinfo, next_tvb, "SQL statement");
proto_tree_add_item(drdaroot_tree, hf_drda_sqlstatement, next_tvb, 0, iLengthParam - 5, ENC_UTF_8|ENC_NA);
proto_tree_add_item(drdaroot_tree, hf_drda_sqlstatement_ebcdic, next_tvb, 0, iLengthParam - 4, ENC_EBCDIC|ENC_NA);
diff --git a/epan/dissectors/packet-dtls.c b/epan/dissectors/packet-dtls.c
index 670d8ee862..854c35866d 100644
--- a/epan/dissectors/packet-dtls.c
+++ b/epan/dissectors/packet-dtls.c
@@ -1467,8 +1467,7 @@ dissect_dtls_handshake(tvbuff_t *tvb, packet_info *pinfo,
}
else
{
- sub_tvb = tvb_new_subset(tvb, offset, fragment_length,
- fragment_length);
+ sub_tvb = tvb_new_subset_length(tvb, offset, fragment_length);
}
/* now dissect the handshake message, if necessary */
diff --git a/epan/dissectors/packet-dua.c b/epan/dissectors/packet-dua.c
index bb5b210857..d8e1375fd4 100644
--- a/epan/dissectors/packet-dua.c
+++ b/epan/dissectors/packet-dua.c
@@ -327,7 +327,7 @@ dissect_protocol_data_parameter(tvbuff_t *parameter_tvb, proto_item *parameter_i
tvbuff_t *protocol_data_tvb;
protocol_data_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
- protocol_data_tvb = tvb_new_subset(parameter_tvb, PROTOCOL_DATA_OFFSET, protocol_data_length, protocol_data_length);
+ protocol_data_tvb = tvb_new_subset_length(parameter_tvb, PROTOCOL_DATA_OFFSET, protocol_data_length);
if(dpnss_handle){
call_dissector(dpnss_handle, protocol_data_tvb, pinfo, tree);
return;
@@ -549,7 +549,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, packet_info *pinfo, proto_tree *tre
if (remaining_length >= length)
total_length = MIN(total_length, remaining_length);
/* create a tvb for the parameter including the padding bytes */
- parameter_tvb = tvb_new_subset(parameters_tvb, offset, total_length, total_length);
+ parameter_tvb = tvb_new_subset_length(parameters_tvb, offset, total_length);
dissect_parameter(parameter_tvb, pinfo, tree, dua_tree);
/* get rid of the handled parameter */
offset += total_length;
@@ -708,7 +708,7 @@ dissect_dua_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree,
{
tvbuff_t *common_header_tvb, *parameters_tvb;
- common_header_tvb = tvb_new_subset(message_tvb, COMMON_HEADER_OFFSET, COMMON_HEADER_LENGTH, COMMON_HEADER_LENGTH);
+ common_header_tvb = tvb_new_subset_length(message_tvb, COMMON_HEADER_OFFSET, COMMON_HEADER_LENGTH);
parameters_tvb = tvb_new_subset_remaining(message_tvb, PARAMETERS_OFFSET);
dissect_common_header(common_header_tvb, pinfo, dua_tree);
dissect_parameters(parameters_tvb, pinfo, tree, dua_tree);
diff --git a/epan/dissectors/packet-dvb-data-mpe.c b/epan/dissectors/packet-dvb-data-mpe.c
index 67803be80f..830987eb53 100644
--- a/epan/dissectors/packet-dvb-data-mpe.c
+++ b/epan/dissectors/packet-dvb-data-mpe.c
@@ -89,9 +89,9 @@ dissect_dvb_data_mpe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Parse the DMC-CC private section header */
- mac_bytes_tvb[5] = tvb_new_subset(tvb, offset, 1, 1);
+ mac_bytes_tvb[5] = tvb_new_subset_length(tvb, offset, 1);
offset += 1;
- mac_bytes_tvb[4] = tvb_new_subset(tvb, offset, 1, 1);
+ mac_bytes_tvb[4] = tvb_new_subset_length(tvb, offset, 1);
offset += 1;
proto_tree_add_item(dvb_data_mpe_tree, hf_dvb_data_mpe_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -109,7 +109,7 @@ dissect_dvb_data_mpe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 1;
for (i = 3; i >= 0; i--) {
- mac_bytes_tvb[i] = tvb_new_subset(tvb, offset, 1, 1);
+ mac_bytes_tvb[i] = tvb_new_subset_length(tvb, offset, 1);
offset += 1;
}
diff --git a/epan/dissectors/packet-dvbci.c b/epan/dissectors/packet-dvbci.c
index 78dca7b196..0a171bec31 100644
--- a/epan/dissectors/packet-dvbci.c
+++ b/epan/dissectors/packet-dvbci.c
@@ -3630,8 +3630,8 @@ dissect_dvbci_ami_file_ack(tvbuff_t *tvb, gint offset,
suffix_lo = wmem_ascii_strdown(wmem_packet_scope(),
&file_name_str[file_name_len-4], -1);
if (g_strcmp0(suffix_lo, ".png")==0) {
- png_file_tvb = tvb_new_subset(
- tvb, offset, file_data_len, file_data_len);
+ png_file_tvb = tvb_new_subset_length(
+ tvb, offset, file_data_len);
}
}
@@ -3898,7 +3898,7 @@ dissect_dvbci_payload_lsc(guint32 tag, gint len_field,
msg_len = tvb_reported_length_remaining(tvb, offset);
if (msg_len<=0)
break;
- msg_tvb = tvb_new_subset(tvb, offset, msg_len, msg_len);
+ msg_tvb = tvb_new_subset_remaining(tvb, offset);
if (!msg_tvb)
break;
if (dvbci_dissect_lsc_msg && circuit && circuit->dissector_handle) {
@@ -3949,8 +3949,8 @@ dissect_dvbci_payload_opp(guint32 tag, gint len_field _U_,
if (nit_loop_len==0)
break;
offset += 2;
- nit_loop_tvb = tvb_new_subset(
- tvb, offset, nit_loop_len, nit_loop_len);
+ nit_loop_tvb = tvb_new_subset_length(
+ tvb, offset, nit_loop_len);
nit_loop_offset = 0;
if (!dvb_nit_handle) {
call_dissector(data_handle, nit_loop_tvb, pinfo, tree);
@@ -4145,7 +4145,7 @@ dissect_dvbci_payload_sas(guint32 tag, gint len_field _U_,
proto_tree_add_item(tree, hf_dvbci_sas_msg_len,
tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- msg_tvb = tvb_new_subset(tvb, offset, msg_len, msg_len);
+ msg_tvb = tvb_new_subset_length(tvb, offset, msg_len);
msg_handle = (circuit && circuit->dissector_handle) ?
circuit->dissector_handle : data_handle;
call_dissector(msg_handle, msg_tvb, pinfo, tree);
@@ -4273,7 +4273,6 @@ dissect_dvbci_spdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint16 ssnb = 0; /* session numbers start with 1, 0 is invalid */
guint8 sess_stat;
tvbuff_t *payload_tvb = NULL;
- gint payload_len;
spdu_len = tvb_reported_length(tvb);
@@ -4372,9 +4371,8 @@ dissect_dvbci_spdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(
sess_tree, hf_dvbci_sess_nb, tvb,
offset, 2, ENC_BIG_ENDIAN);
- payload_len = tvb_reported_length_remaining(tvb, offset+2);
payload_tvb =
- tvb_new_subset(tvb, offset+2, payload_len, payload_len);
+ tvb_new_subset_remaining(tvb, offset+2);
break;
default:
break;
@@ -4598,7 +4596,7 @@ dissect_dvbci_tpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
the reassembled bodies as expected
to work around this issue, we use a dedicated body_tvb as
input to reassembly routines */
- body_tvb = tvb_new_subset(tvb, offset, body_len, body_len);
+ body_tvb = tvb_new_subset_length(tvb, offset, body_len);
/* dissect_dvbci_tpdu_hdr() checked that lpdu_tcid==t_c_id */
frag_msg = fragment_add_seq_next(&spdu_reassembly_table,
body_tvb, 0, pinfo, SPDU_SEQ_ID_BASE+lpdu_tcid, NULL,
@@ -4939,7 +4937,7 @@ dissect_dvbci_cis(tvbuff_t *tvb, gint offset,
tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
- tpl_data_tvb = tvb_new_subset(tvb, offset, len_field, len_field);
+ tpl_data_tvb = tvb_new_subset_length(tvb, offset, len_field);
switch (tpl_code) {
case CISTPL_VERS_1:
dissect_dvbci_cis_payload_tpll_v1(
diff --git a/epan/dissectors/packet-ehdlc.c b/epan/dissectors/packet-ehdlc.c
index aa8025b9eb..d4b711bcb8 100644
--- a/epan/dissectors/packet-ehdlc.c
+++ b/epan/dissectors/packet-ehdlc.c
@@ -161,8 +161,8 @@ dissect_ehdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
header_length += XDLC_CONTROL_LEN(control, is_extended);
if (XDLC_IS_INFORMATION(control)) {
- next_tvb = tvb_new_subset(tvb, offset+header_length,
- len-header_length, len-header_length);
+ next_tvb = tvb_new_subset_length(tvb, offset+header_length,
+ len-header_length);
switch (msg_type) {
case 0x20:
diff --git a/epan/dissectors/packet-eigrp.c b/epan/dissectors/packet-eigrp.c
index b2bc63f240..9e03f5e0fb 100644
--- a/epan/dissectors/packet-eigrp.c
+++ b/epan/dissectors/packet-eigrp.c
@@ -1335,7 +1335,7 @@ dissect_eigrp_service (proto_item *ti, proto_tree *tree, tvbuff_t *tvb,
* XML. If it "looks like" XML (begins with optional white-space
* followed by a '<'), try XML. Otherwise, try plain-text.
*/
- xml_tvb = tvb_new_subset(sub_tvb, sub_offset, length, length);
+ xml_tvb = tvb_new_subset_length(sub_tvb, sub_offset, length);
test_string = tvb_get_string(wmem_packet_scope(), xml_tvb, 0, (length < 32 ?
length : 32));
tok = strtok(test_string, " \t\r\n");
diff --git a/epan/dissectors/packet-eiss.c b/epan/dissectors/packet-eiss.c
index c58ab51b65..0bca7184b0 100644
--- a/epan/dissectors/packet-eiss.c
+++ b/epan/dissectors/packet-eiss.c
@@ -243,7 +243,7 @@ dissect_eiss_descriptors(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu
offset, 4, ENC_BIG_ENDIAN);
offset += 4;
- payload = tvb_new_subset(tvb, offset, tmp-4, tmp-4);
+ payload = tvb_new_subset_length(tvb, offset, tmp-4);
call_dissector(data_handle, payload, pinfo, sub_tree);
return (3+tmp);
diff --git a/epan/dissectors/packet-enip.c b/epan/dissectors/packet-enip.c
index 3dd3e55019..5519d765ec 100644
--- a/epan/dissectors/packet-enip.c
+++ b/epan/dissectors/packet-enip.c
@@ -1428,7 +1428,7 @@ dissect_tcpip_last_conflict(packet_info *pinfo, proto_tree *tree, proto_item *it
save_info = col_get_writable(pinfo->cinfo);
col_set_writable(pinfo->cinfo, FALSE);
- next_tvb = tvb_new_subset(tvb, offset+7, 28, 28);
+ next_tvb = tvb_new_subset_length(tvb, offset+7, 28);
call_dissector(arp_handle, next_tvb, pinfo, tree);
col_set_writable(pinfo->cinfo, save_info);
@@ -1827,7 +1827,7 @@ dissect_cpf(enip_request_key_t *request_key, int command, tvbuff_t *tvb,
}
/* Call dissector for interface */
- next_tvb = tvb_new_subset( tvb, offset+6, item_length, item_length );
+ next_tvb = tvb_new_subset_length( tvb, offset+6, item_length);
p_add_proto_data(wmem_file_scope(), pinfo, proto_enip, ENIP_REQUEST_INFO, request_info);
if ( tvb_length_remaining(next_tvb, 0) <= 0 || !dissector_try_uint(subdissector_srrd_table, ifacehndl, next_tvb, pinfo, dissector_tree) )
{
@@ -1886,7 +1886,7 @@ dissect_cpf(enip_request_key_t *request_key, int command, tvbuff_t *tvb,
proto_tree_add_item( item_tree, hf_enip_cpf_cdi_seqcnt, tvb, offset+6, 2, ENC_LITTLE_ENDIAN );
/* Call dissector for interface */
- next_tvb = tvb_new_subset (tvb, offset+8, item_length-2, item_length-2);
+ next_tvb = tvb_new_subset_length (tvb, offset+8, item_length-2);
p_add_proto_data(wmem_file_scope(), pinfo, proto_enip, ENIP_REQUEST_INFO, request_info);
if ( tvb_length_remaining(next_tvb, 0) <= 0 || !dissector_try_uint(subdissector_sud_table, ifacehndl, next_tvb, pinfo, dissector_tree) )
{
@@ -1901,7 +1901,7 @@ dissect_cpf(enip_request_key_t *request_key, int command, tvbuff_t *tvb,
/* Display data */
if (tvb_length_remaining(tvb, offset+6) > 0)
{
- next_tvb = tvb_new_subset(tvb, offset+6, item_length, item_length);
+ next_tvb = tvb_new_subset_length(tvb, offset+6, item_length);
if (conn_info != NULL)
{
if (conn_info->safety.safety_seg == TRUE)
diff --git a/epan/dissectors/packet-enrp.c b/epan/dissectors/packet-enrp.c
index 6edcd62371..d255e370fd 100644
--- a/epan/dissectors/packet-enrp.c
+++ b/epan/dissectors/packet-enrp.c
@@ -234,7 +234,7 @@ dissect_error_causes(tvbuff_t *error_causes_tvb, proto_tree *parameter_tree)
while(tvb_reported_length_remaining(error_causes_tvb, offset) > 0) {
length = tvb_get_ntohs(error_causes_tvb, offset + CAUSE_LENGTH_OFFSET);
total_length = ADD_PADDING(length);
- error_cause_tvb = tvb_new_subset(error_causes_tvb, offset , total_length, total_length);
+ error_cause_tvb = tvb_new_subset_length(error_causes_tvb, offset, total_length);
dissect_error_cause(error_cause_tvb, parameter_tree);
offset += total_length;
}
@@ -720,7 +720,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, proto_tree *tree)
if (remaining_length >= length)
total_length = MIN(total_length, remaining_length);
/* create a tvb for the parameter including the padding bytes */
- parameter_tvb = tvb_new_subset(parameters_tvb, offset, total_length, total_length);
+ parameter_tvb = tvb_new_subset_length(parameters_tvb, offset, total_length);
dissect_parameter(parameter_tvb, tree);
/* get rid of the handled parameter */
offset += total_length;
diff --git a/epan/dissectors/packet-etsi_card_app_toolkit.c b/epan/dissectors/packet-etsi_card_app_toolkit.c
index 383cbec135..4de87ac659 100644
--- a/epan/dissectors/packet-etsi_card_app_toolkit.c
+++ b/epan/dissectors/packet-etsi_card_app_toolkit.c
@@ -1054,7 +1054,7 @@ dissect_cat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
de_cld_party_bcd_num(tvb, elem_tree, pinfo, pos, len, NULL, 0);
break;
case 0x0b: /* sms tpdu */
- new_tvb = tvb_new_subset(tvb, pos, len, len);
+ new_tvb = tvb_new_subset_length(tvb, pos, len);
if (new_tvb) {
int p2p_dir_save = pinfo->p2p_dir;
if (data) {
diff --git a/epan/dissectors/packet-etv.c b/epan/dissectors/packet-etv.c
index c8bc37b3ec..2aed9ef1a2 100644
--- a/epan/dissectors/packet-etv.c
+++ b/epan/dissectors/packet-etv.c
@@ -130,7 +130,7 @@ dissect_etv_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int prot
}
offset += 1;
- sub_tvb = tvb_new_subset(tvb, offset, sect_len-7, sect_len-7);
+ sub_tvb = tvb_new_subset_length(tvb, offset, sect_len-7);
call_dissector(dsmcc_handle, sub_tvb, pinfo, tree);
sect_len += 3 - 4; /* add header, remove crc */
diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c
index 9700c215a3..702d3f7dc9 100644
--- a/epan/dissectors/packet-fc.c
+++ b/epan/dissectors/packet-fc.c
@@ -1263,7 +1263,6 @@ dissect_fcsof(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
proto_item *it = NULL;
proto_tree *fcsof_tree = NULL;
- gint bytes_remaining;
tvbuff_t *next_tvb, *checksum_tvb;
guint32 sof = 0;
guint32 crc = 0;
@@ -1291,7 +1290,7 @@ dissect_fcsof(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
/* GET Computed CRC */
frame_len_for_checksum = crc_offset - FCSOF_HEADER_LEN;
- checksum_tvb = tvb_new_subset(tvb, 4, frame_len_for_checksum, frame_len_for_checksum);
+ checksum_tvb = tvb_new_subset_length(tvb, 4, frame_len_for_checksum);
crc_computed = crc32_802_tvb(checksum_tvb, frame_len_for_checksum);
/* Get EOF */
@@ -1323,8 +1322,7 @@ dissect_fcsof(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
proto_tree_add_uint(fcsof_tree, hf_fceof, tvb, eof_offset, 4, eof);
- bytes_remaining = tvb_length_remaining(tvb, 4);
- next_tvb = tvb_new_subset(tvb, 4, bytes_remaining, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 4);
fc_data.ethertype = 0;
fc_data.sof_eof = 0;
diff --git a/epan/dissectors/packet-fcp.c b/epan/dissectors/packet-fcp.c
index bc8083671e..fdcd9de7cf 100644
--- a/epan/dissectors/packet-fcp.c
+++ b/epan/dissectors/packet-fcp.c
@@ -490,7 +490,7 @@ dissect_fcp_cmnd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, pro
itl.cmdset = 0xff;
itl.conversation = conversation;
- cdb_tvb = tvb_new_subset(tvb, offset+12, tvb_len, tvb_rlen);
+ cdb_tvb = tvb_new_subset_length(tvb, offset+12, tvb_len);
dissect_scsi_cdb(cdb_tvb, pinfo, parent_tree, SCSI_DEV_UNKNOWN, request_data->itlq, &itl);
proto_tree_add_item(tree, hf_fcp_dl, tvb, offset+12+16+add_len,
diff --git a/epan/dissectors/packet-flip.c b/epan/dissectors/packet-flip.c
index a2daa2f0f3..074233addb 100644
--- a/epan/dissectors/packet-flip.c
+++ b/epan/dissectors/packet-flip.c
@@ -430,7 +430,7 @@ dissect_flip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
col_add_fstr(pinfo->cinfo, COL_INFO,
"FlowID %s", val_to_str(basic_hdr_flow_id, NULL, "0x%08x"));
- flip_tvb = tvb_new_subset(tvb, 0, frame_len, frame_len);
+ flip_tvb = tvb_new_subset_length(tvb, 0, frame_len);
/* We are asked for details. */
if (tree) {
@@ -539,8 +539,7 @@ dissect_flip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
computed_chksum = g_htons(computed_chksum);
}
- chksum_tvb = tvb_new_subset(flip_tvb, offset,
- FLIP_CHKSUM_HDR_LEN,
+ chksum_tvb = tvb_new_subset_length(flip_tvb, offset,
FLIP_CHKSUM_HDR_LEN);
/* Note that flip_tree is NULL if no details are requested. */
@@ -575,8 +574,8 @@ dissect_flip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
has_user_messed_up = FALSE;
- payload_tvb = tvb_new_subset(flip_tvb, offset,
- payload_len, payload_len);
+ payload_tvb = tvb_new_subset_length(flip_tvb, offset,
+ payload_len);
/*
* 1) no decoding -> data
diff --git a/epan/dissectors/packet-forces.c b/epan/dissectors/packet-forces.c
index e007822779..53b5ae261f 100644
--- a/epan/dissectors/packet-forces.c
+++ b/epan/dissectors/packet-forces.c
@@ -470,7 +470,7 @@ dissect_redirecttlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint of
{
tvbuff_t *next_tvb;
- next_tvb = tvb_new_subset(tvb, offset+4, length_redirect-TLV_TL_LENGTH, length_redirect-TLV_TL_LENGTH);
+ next_tvb = tvb_new_subset_length(tvb, offset+4, length_redirect-TLV_TL_LENGTH);
call_dissector(ip_handle, next_tvb, pinfo, redirect_data_tree);
/* Restore IP info */
diff --git a/epan/dissectors/packet-gdb.c b/epan/dissectors/packet-gdb.c
index 23b1355ac9..8e77d2d43f 100644
--- a/epan/dissectors/packet-gdb.c
+++ b/epan/dissectors/packet-gdb.c
@@ -182,8 +182,8 @@ dissect_gdb_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_bytes_exist(tvb, offset, 2)) {
offset += 2;
packet_len = offset-offset_start;
- packet_tvb = tvb_new_subset(tvb, offset_start,
- packet_len, packet_len);
+ packet_tvb = tvb_new_subset_length(tvb, offset_start,
+ packet_len);
}
}
diff --git a/epan/dissectors/packet-gpef.c b/epan/dissectors/packet-gpef.c
index 39702c7ec8..a492de46b9 100644
--- a/epan/dissectors/packet-gpef.c
+++ b/epan/dissectors/packet-gpef.c
@@ -100,7 +100,7 @@ dissect_gpef_efskey(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *p
dissect_nt_sid(tvb, old_offset+4+sid_offset, tree, "sid", NULL, -1);
/* certificate */
- next_tvb = tvb_new_subset(tvb, old_offset+4+cert_offset, cert_length, cert_length);
+ next_tvb = tvb_new_subset_length(tvb, old_offset+4+cert_offset, cert_length);
(void)dissect_x509af_Certificate(FALSE, next_tvb, 0, &asn1_ctx, tree, hf_gpef_efskey_certificate);
diff --git a/epan/dissectors/packet-gprs-llc.c b/epan/dissectors/packet-gprs-llc.c
index 2d8f63c620..a6ce57bc31 100644
--- a/epan/dissectors/packet-gprs-llc.c
+++ b/epan/dissectors/packet-gprs-llc.c
@@ -397,7 +397,7 @@ static void llc_gprs_dissect_xid(tvbuff_t *tvb,
if (xid_param_len) {
- sndcp_xid_tvb = tvb_new_subset (tvb, location+sndcp_xid_offset, xid_param_len, xid_param_len);
+ sndcp_xid_tvb = tvb_new_subset_length (tvb, location+sndcp_xid_offset, xid_param_len);
if(sndcp_xid_handle)
{
@@ -1071,7 +1071,7 @@ dissect_llcgprs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree)
{
tvbuff_t *xid_tvb;
- xid_tvb = tvb_new_subset (tvb, offset, info_len, info_len);
+ xid_tvb = tvb_new_subset_length (tvb, offset, info_len);
llc_gprs_dissect_xid(xid_tvb, pinfo, llcgprs_tree);
}
@@ -1083,7 +1083,7 @@ dissect_llcgprs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree)
{
tvbuff_t *xid_tvb;
- xid_tvb = tvb_new_subset (tvb, offset, info_len, info_len);
+ xid_tvb = tvb_new_subset_length (tvb, offset, info_len);
llc_gprs_dissect_xid(xid_tvb, pinfo, llcgprs_tree);
}
diff --git a/epan/dissectors/packet-gsm_a_bssmap.c b/epan/dissectors/packet-gsm_a_bssmap.c
index cb5ed285af..284d7a2e9d 100644
--- a/epan/dissectors/packet-gsm_a_bssmap.c
+++ b/epan/dissectors/packet-gsm_a_bssmap.c
@@ -2012,7 +2012,7 @@ be_l3_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset,
/*
* dissect the embedded DTAP message
*/
- l3_tvb = tvb_new_subset(tvb, curr_offset, len, len);
+ l3_tvb = tvb_new_subset_length(tvb, curr_offset, len);
/* This information element carries a radio interface message.
In the case of an Intersystem handover to UMTS,
@@ -2488,7 +2488,7 @@ be_l3_msg(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g
/*
* dissect the embedded DTAP message
*/
- l3_tvb = tvb_new_subset(tvb, offset, len, len);
+ l3_tvb = tvb_new_subset_length(tvb, offset, len);
/* Octet j (j = 3, 4, ..., n) is the unchanged octet j of a radio interface layer 3 message
* as defined in 3GPP TS 24.008, n is equal to the length of that radio interface layer 3 message. */
@@ -3044,7 +3044,7 @@ be_loc_est(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset,
curr_offset = offset;
- data_tvb = tvb_new_subset(tvb, curr_offset, len, len);
+ data_tvb = tvb_new_subset_length(tvb, curr_offset, len);
dissect_geographical_description(data_tvb, pinfo, tree);
return(len);
@@ -3148,7 +3148,7 @@ be_apdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, gui
/* BSSLAP
* the embedded message is as defined in 3GPP TS 08.71(3GPP TS 48.071 version 7.2.0 Release 7)
*/
- APDU_tvb = tvb_new_subset(tvb, curr_offset, len, len);
+ APDU_tvb = tvb_new_subset_length(tvb, curr_offset, len);
if (gsm_bsslap_handle)
call_dissector(gsm_bsslap_handle, APDU_tvb, pinfo, g_tree);
break;
@@ -3289,7 +3289,7 @@ be_src_rnc_to_tar_rnc_umts(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
* the Source RNC to Target RNC Transparent Container IE as defined in relevant
* RANAP specification 3GPP TS 25.413, excluding RANAP tag
*/
- container_tvb = tvb_new_subset(tvb, curr_offset, len, len);
+ container_tvb = tvb_new_subset_length(tvb, curr_offset, len);
dissect_ranap_SourceRNC_ToTargetRNC_TransparentContainer_PDU(container_tvb, pinfo, tree, NULL);
return(len);
@@ -3402,7 +3402,7 @@ be_inter_sys_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint3
{
tvbuff_t *new_tvb;
- new_tvb = tvb_new_subset(tvb, offset, len, len);
+ new_tvb = tvb_new_subset_length(tvb, offset, len);
if (new_tvb) {
dissect_ranap_InterSystemInformation_TransparentContainer_PDU(new_tvb, pinfo, tree, NULL);
@@ -3806,7 +3806,7 @@ be_app_data_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32
{
tvbuff_t *new_tvb;
- new_tvb = tvb_new_subset(tvb, offset, len, len);
+ new_tvb = tvb_new_subset_length(tvb, offset, len);
if (new_tvb) {
dissect_gsm_map_msisdn(new_tvb, pinfo , tree);
}
@@ -4835,7 +4835,7 @@ be_fe_inter_rat_handover_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinf
tvbuff_t *container_tvb;
/* Octets 3-n are encoded as Inter RAT Handover Info as defined in 3GPP TS 25.331 */
- container_tvb = tvb_new_subset(tvb, offset, len, len);
+ container_tvb = tvb_new_subset_length(tvb, offset, len);
dissect_rrc_InterRATHandoverInfo_PDU(container_tvb, pinfo, tree, NULL);
return len;
diff --git a/epan/dissectors/packet-gsm_a_dtap.c b/epan/dissectors/packet-gsm_a_dtap.c
index e400a878d1..4fbf706c8e 100644
--- a/epan/dissectors/packet-gsm_a_dtap.c
+++ b/epan/dissectors/packet-gsm_a_dtap.c
@@ -2638,7 +2638,7 @@ de_facility(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset,
dissect_ROS_Component(FALSE, tvb, offset, &asn1_ctx, tree, hf_ROS_component);
TODO Call gsm map here
*/
- SS_tvb = tvb_new_subset(tvb, offset, component_len, component_len);
+ SS_tvb = tvb_new_subset_length(tvb, offset, component_len);
col_append_str(pinfo->cinfo, COL_INFO,"(GSM MAP) ");
col_set_fence(pinfo->cinfo, COL_INFO);
call_dissector(gsm_map_handle, SS_tvb, pinfo, tree);
@@ -3324,7 +3324,7 @@ de_cp_user_data(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off
/*
* dissect the embedded RP message
*/
- rp_tvb = tvb_new_subset(tvb, curr_offset, len, len);
+ rp_tvb = tvb_new_subset_length(tvb, curr_offset, len);
call_dissector(rp_handle, rp_tvb, pinfo, g_tree);
diff --git a/epan/dissectors/packet-gsm_a_gm.c b/epan/dissectors/packet-gsm_a_gm.c
index 17970634e6..a68c9f1780 100644
--- a/epan/dissectors/packet-gsm_a_gm.c
+++ b/epan/dissectors/packet-gsm_a_gm.c
@@ -3339,7 +3339,7 @@ de_gmm_rat_info_container(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, g
/* The value part of the Inter RAT information container information element is the INTER RAT HANDOVER INFO as
defined in 3GPP TS 25.331 [23c]. If this field includes padding bits, they are defined in 3GPP TS 25.331 [23c].*/
- rrc_irat_ho_info_tvb = tvb_new_subset(tvb, curr_offset, len, len);
+ rrc_irat_ho_info_tvb = tvb_new_subset_length(tvb, curr_offset, len);
if (rrc_irat_ho_info_handle)
call_dissector(rrc_irat_ho_info_handle, rrc_irat_ho_info_tvb, pinfo, tree);
else
@@ -3394,7 +3394,7 @@ de_gmm_eutran_irat_info_container(tvbuff_t *tvb, proto_tree *tree, packet_info *
/* The value part of the E-UTRAN inter RAT information container information element
is formatted and coded according to the UE-EUTRA-Capability IE defined in 3GPP TS 36.331 [129]*/
- lte_rrc_ue_eutra_cap_tvb = tvb_new_subset(tvb, curr_offset, len, len);
+ lte_rrc_ue_eutra_cap_tvb = tvb_new_subset_length(tvb, curr_offset, len);
if (lte_rrc_ue_eutra_cap_handle)
call_dissector(lte_rrc_ue_eutra_cap_handle, lte_rrc_ue_eutra_cap_tvb, pinfo, tree);
else
@@ -4086,12 +4086,12 @@ de_sm_pco(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g
} else {
dissector_handle_t handle;
handle = dissector_get_uint_handle (gprs_sm_pco_subdissector_table, prot);
+ l3_tvb = tvb_new_subset_length(tvb, curr_offset, e_len);
if (handle != NULL)
{
/*
* dissect the embedded message
*/
- l3_tvb = tvb_new_subset(tvb, curr_offset, e_len, e_len);
/* In this case we do not want the columns updated */
col_set_writable(pinfo->cinfo, FALSE);
call_dissector(handle, l3_tvb, pinfo, pco_tree);
@@ -4102,7 +4102,6 @@ de_sm_pco(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g
/*
* dissect the embedded DATA message
*/
- l3_tvb = tvb_new_subset(tvb, curr_offset, e_len, e_len);
call_dissector(data_handle, l3_tvb, pinfo, pco_tree);
}
}
diff --git a/epan/dissectors/packet-gsm_a_rp.c b/epan/dissectors/packet-gsm_a_rp.c
index cb0554c150..2dcf3ae2c6 100644
--- a/epan/dissectors/packet-gsm_a_rp.c
+++ b/epan/dissectors/packet-gsm_a_rp.c
@@ -159,7 +159,7 @@ de_rp_user_data(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off
/*
* dissect the embedded TPDU message
*/
- tpdu_tvb = tvb_new_subset(tvb, curr_offset, len, len);
+ tpdu_tvb = tvb_new_subset_length(tvb, curr_offset, len);
call_dissector_only(gsm_sms_handle, tpdu_tvb, pinfo, g_tree, NULL);
diff --git a/epan/dissectors/packet-gsm_a_rr.c b/epan/dissectors/packet-gsm_a_rr.c
index 1121cb7b58..16434a4d39 100644
--- a/epan/dissectors/packet-gsm_a_rr.c
+++ b/epan/dissectors/packet-gsm_a_rr.c
@@ -2021,7 +2021,7 @@ de_rr_utran_cm(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offs
curr_offset = offset;
if (len)
{
- rrc_irat_ho_info_tvb = tvb_new_subset(tvb, curr_offset, len, len);
+ rrc_irat_ho_info_tvb = tvb_new_subset_length(tvb, curr_offset, len);
if (rrc_irat_ho_info_handle)
call_dissector(rrc_irat_ho_info_handle, rrc_irat_ho_info_tvb, pinfo, tree);
}
@@ -8031,7 +8031,7 @@ de_rr_apdu_data(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32
{
tvbuff_t *sub_tvb;
- sub_tvb = tvb_new_subset(tvb, offset, len, len);
+ sub_tvb = tvb_new_subset_length(tvb, offset, len);
if (rrlp_dissector)
call_dissector(rrlp_dissector, sub_tvb,pinfo, tree);
@@ -8051,7 +8051,7 @@ de_rr_ho_to_utran_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint
curr_offset = offset;
if (len)
{
- rrc_irat_ho_to_utran_cmd_tvb = tvb_new_subset(tvb, curr_offset, len, len);
+ rrc_irat_ho_to_utran_cmd_tvb = tvb_new_subset_length(tvb, curr_offset, len);
if (rrc_irat_ho_to_utran_cmd_handle)
call_dissector(rrc_irat_ho_to_utran_cmd_handle, rrc_irat_ho_to_utran_cmd_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-gsm_abis_oml.c b/epan/dissectors/packet-gsm_abis_oml.c
index ee5a2ba6f9..4b930bda80 100644
--- a/epan/dissectors/packet-gsm_abis_oml.c
+++ b/epan/dissectors/packet-gsm_abis_oml.c
@@ -1578,7 +1578,7 @@ dissect_oml_attrs(tvbuff_t *tvb, int base_offs, packet_info *pinfo,
offset+1, len_len, len);
offset += hlen;
- sub_tvb = tvb_new_subset(tvb, offset, len, len);
+ sub_tvb = tvb_new_subset_length(tvb, offset, len);
switch (tag) {
/* parse only the most common IE for now */
@@ -1845,7 +1845,7 @@ dissect_abis_oml(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
* putting all of that into an external dissector and
* call out to that dissector */
tvbuff_t *subtvb;
- subtvb = tvb_new_subset(tvb, offset, len, len);
+ subtvb = tvb_new_subset_length(tvb, offset, len);
if (sub_om2000)
call_dissector(sub_om2000, subtvb, pinfo, tree);
diff --git a/epan/dissectors/packet-gsm_bsslap.c b/epan/dissectors/packet-gsm_bsslap.c
index f01cbf919a..4f4a0ec60c 100644
--- a/epan/dissectors/packet-gsm_bsslap.c
+++ b/epan/dissectors/packet-gsm_bsslap.c
@@ -250,7 +250,7 @@ de_rrlp_ie(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset,
curr_offset = offset + 2;
if (length > 0)
{
- rrlp_tvb = tvb_new_subset(tvb, curr_offset, length, length);
+ rrlp_tvb = tvb_new_subset_length(tvb, curr_offset, length);
if (bsslap_rrlp_handle)
call_dissector(bsslap_rrlp_handle, rrlp_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-gsm_bssmap_le.c b/epan/dissectors/packet-gsm_bssmap_le.c
index ea6755f96e..9aa587bd21 100644
--- a/epan/dissectors/packet-gsm_bssmap_le.c
+++ b/epan/dissectors/packet-gsm_bssmap_le.c
@@ -259,7 +259,7 @@ de_bmaple_apdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offs
/* BSSLAP
* the embedded message is as defined in 3GPP TS 08.71(3GPP TS 48.071 version 7.2.0 Release 7)
*/
- APDU_tvb = tvb_new_subset(tvb, curr_offset+1, len-1, len-1);
+ APDU_tvb = tvb_new_subset_length(tvb, curr_offset+1, len-1);
if(gsm_bsslap_handle)
call_dissector(gsm_bsslap_handle, APDU_tvb, pinfo, g_tree);
break;
@@ -565,7 +565,7 @@ de_bmaple_pos_dta(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 o
curr_offset = offset;
- data_tvb = tvb_new_subset(tvb, curr_offset, len, len);
+ data_tvb = tvb_new_subset_length(tvb, curr_offset, len);
dissect_geographical_description(data_tvb, pinfo, tree);
return(len);
diff --git a/epan/dissectors/packet-gsm_ipa.c b/epan/dissectors/packet-gsm_ipa.c
index 33250dcc83..4653a36f28 100644
--- a/epan/dissectors/packet-gsm_ipa.c
+++ b/epan/dissectors/packet-gsm_ipa.c
@@ -326,7 +326,7 @@ dissect_ipa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb, offset+2, 1, ENC_BIG_ENDIAN);
}
- next_tvb = tvb_new_subset(tvb, offset+header_length, len, len);
+ next_tvb = tvb_new_subset_length(tvb, offset+header_length, len);
switch (msg_type) {
case ABISIP_OML:
diff --git a/epan/dissectors/packet-gsm_rlcmac.c b/epan/dissectors/packet-gsm_rlcmac.c
index e72930b30b..33be85e148 100644
--- a/epan/dissectors/packet-gsm_rlcmac.c
+++ b/epan/dissectors/packet-gsm_rlcmac.c
@@ -6999,7 +6999,7 @@ static guint8 dissect_gprs_data_segments(tvbuff_t *tvb, packet_info *pinfo, prot
i, li);
}
subtree = proto_item_add_subtree(ti, ett_data_segments);
- data_tvb = tvb_new_subset(tvb, octet_offset, octet_length - octet_offset, octet_length - octet_offset);
+ data_tvb = tvb_new_subset_length(tvb, octet_offset, octet_length - octet_offset);
call_dissector(data_handle, data_tvb, pinfo, subtree);
octet_offset = octet_length;
break;
@@ -7009,7 +7009,7 @@ static guint8 dissect_gprs_data_segments(tvbuff_t *tvb, packet_info *pinfo, prot
"data segment: LI[%d]=%d indicates: (Last segment of) LLC frame (%d octets)",
i, li, li);
subtree = proto_item_add_subtree(ti, ett_data_segments);
- data_tvb = tvb_new_subset(tvb, octet_offset, li, li);
+ data_tvb = tvb_new_subset_length(tvb, octet_offset, li);
call_dissector(data_handle, data_tvb, pinfo, subtree);
octet_offset += li;
break;
@@ -7029,7 +7029,7 @@ static guint8 dissect_gprs_data_segments(tvbuff_t *tvb, packet_info *pinfo, prot
ti = proto_tree_add_text(tree, tvb, octet_offset, octet_length - octet_offset, "Padding Octets");
}
subtree = proto_item_add_subtree(ti, ett_data_segments);
- data_tvb = tvb_new_subset(tvb, octet_offset, octet_length - octet_offset, octet_length - octet_offset);
+ data_tvb = tvb_new_subset_length(tvb, octet_offset, octet_length - octet_offset);
call_dissector(data_handle, data_tvb, pinfo, subtree);
octet_offset = octet_length;
}
@@ -7115,7 +7115,7 @@ static guint16 dissect_egprs_data_segments(tvbuff_t *tvb, packet_info *pinfo, pr
i, li);
}
subtree = proto_item_add_subtree(ti, ett_data_segments);
- data_tvb = tvb_new_subset(tvb, octet_offset, octet_length - octet_offset, octet_length - octet_offset);
+ data_tvb = tvb_new_subset_length(tvb, octet_offset, octet_length - octet_offset);
call_dissector(data_handle, data_tvb, pinfo, subtree);
octet_offset = octet_length;
break;
@@ -7125,7 +7125,7 @@ static guint16 dissect_egprs_data_segments(tvbuff_t *tvb, packet_info *pinfo, pr
"data segment: LI[%d]=%d indicates: (Last segment of) LLC frame (%d octets)",
i, li, li);
subtree = proto_item_add_subtree(ti, ett_data_segments);
- data_tvb = tvb_new_subset(tvb, octet_offset, li, li);
+ data_tvb = tvb_new_subset_length(tvb, octet_offset, li);
call_dissector(data_handle, data_tvb, pinfo, subtree);
octet_offset += li;
break;
@@ -7138,7 +7138,7 @@ static guint16 dissect_egprs_data_segments(tvbuff_t *tvb, packet_info *pinfo, pr
ti = proto_tree_add_text(tree, tvb, octet_offset, octet_length - octet_offset,
"data segment: LI not present: \n The Upper Layer PDU in the current RLC data block either fills the current RLC data block precisely \nor continues in the following in-sequence RLC data block");
subtree = proto_item_add_subtree(ti, ett_data_segments);
- data_tvb = tvb_new_subset(tvb, octet_offset, octet_length - octet_offset, octet_length - octet_offset);
+ data_tvb = tvb_new_subset_length(tvb, octet_offset, octet_length - octet_offset);
call_dissector(data_handle, data_tvb, pinfo, subtree);
octet_offset = octet_length;
}
diff --git a/epan/dissectors/packet-gsm_sim.c b/epan/dissectors/packet-gsm_sim.c
index a8f5897307..c02aa8e26c 100644
--- a/epan/dissectors/packet-gsm_sim.c
+++ b/epan/dissectors/packet-gsm_sim.c
@@ -1131,7 +1131,7 @@ dissect_bertlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
- subtvb = tvb_new_subset(tvb, pos, len, len);
+ subtvb = tvb_new_subset_length(tvb, pos, len);
switch (tag) {
case 0xD0: /* proactive command */
case 0xD1: /* sms-pp download */
@@ -1302,12 +1302,12 @@ dissect_gsm_apdu(guint8 ins, guint8 p1, guint8 p2, guint8 p3, tvbuff_t *tvb,
case 0x12: /* FETCH */
proto_tree_add_item(tree, hf_le, tvb, offset+P3_OFFS, 1, ENC_BIG_ENDIAN);
if (isSIMtrace) {
- subtvb = tvb_new_subset(tvb, offset+DATA_OFFS, p3, p3);
+ subtvb = tvb_new_subset_length(tvb, offset+DATA_OFFS, p3);
dissect_bertlv(subtvb, pinfo, tree);
}
break;
case 0x14: /* TERMINAL RESPONSE */
- subtvb = tvb_new_subset(tvb, offset+DATA_OFFS, p3, p3);
+ subtvb = tvb_new_subset_length(tvb, offset+DATA_OFFS, p3);
call_dissector_with_data(sub_handle_cap, subtvb, pinfo, tree, GUINT_TO_POINTER(0x14));
break;
case 0x70: /* MANAGE CHANNEL */
@@ -1336,7 +1336,7 @@ dissect_gsm_apdu(guint8 ins, guint8 p1, guint8 p2, guint8 p3, tvbuff_t *tvb,
break;
case 0xC2: /* ENVELOPE */
proto_tree_add_item(tree, hf_le, tvb, offset+P3_OFFS, 1, ENC_BIG_ENDIAN);
- subtvb = tvb_new_subset(tvb, offset+DATA_OFFS, p3, p3);
+ subtvb = tvb_new_subset_length(tvb, offset+DATA_OFFS, p3);
dissect_bertlv(subtvb, pinfo, tree);
break;
/* FIXME: Missing SLEEP */
diff --git a/epan/dissectors/packet-gsmtap.c b/epan/dissectors/packet-gsmtap.c
index 598fca3437..da057d7551 100644
--- a/epan/dissectors/packet-gsmtap.c
+++ b/epan/dissectors/packet-gsmtap.c
@@ -490,12 +490,10 @@ dissect_gsmtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* of the packet (see TS 04.04) */
if (type == GSMTAP_TYPE_UM &&
sub_type & GSMTAP_CHANNEL_ACCH) {
- l1h_tvb = tvb_new_subset(tvb, hdr_len, 2, 2);
- payload_tvb = tvb_new_subset(tvb, hdr_len+2, len-(hdr_len+2),
- len-(hdr_len+2));
+ l1h_tvb = tvb_new_subset_length(tvb, hdr_len, 2);
+ payload_tvb = tvb_new_subset_length(tvb, hdr_len+2, len-(hdr_len+2));
} else {
- payload_tvb = tvb_new_subset(tvb, hdr_len, len-hdr_len,
- len-hdr_len);
+ payload_tvb = tvb_new_subset_length(tvb, hdr_len, len-hdr_len);
}
/* We don't want any UDP related info left in the INFO field, as the
diff --git a/epan/dissectors/packet-gtp.c b/epan/dissectors/packet-gtp.c
index 8bb6b0a372..0845e6a134 100644
--- a/epan/dissectors/packet-gtp.c
+++ b/epan/dissectors/packet-gtp.c
@@ -4868,7 +4868,7 @@ decode_gtp_proto_conf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tre
* between the GGSN and the MS. The content and the coding of the Protocol Configuration are defined in octet 3-z of the
* Protocol Configuration Options in3GPP TS 24.008 [5].
*/
- next_tvb = tvb_new_subset(tvb, offset + 3, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset + 3, length);
de_sm_pco(next_tvb, ext_tree_proto, pinfo, 0, length, NULL, 0);
return 3 + length;
@@ -4957,7 +4957,7 @@ decode_gtp_msisdn(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree *
if (length < 1)
return 3;
- next_tvb = tvb_new_subset(tvb, offset+3, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset+3, length);
dissect_gsm_map_msisdn(next_tvb, pinfo, ext_tree_proto);
return 3 + length;
@@ -5405,7 +5405,7 @@ decode_gtp_ran_tr_cont(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tr
proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
offset = offset + 2;
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
if (bssgp_handle) {
#if 0
col_set_fence(pinfo->cinfo, COL_INFO);
@@ -5843,7 +5843,7 @@ decode_gtp_imeisv(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tre
* then the IMEI shall be placed in the IMEI(SV) field and the last semi-octet of octet 11 shall be
* set to '1111'. Both IMEI and IMEISV are BCD encoded.
*/
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
digit_str = unpack_digits(next_tvb, 0);
proto_tree_add_string(ext_imeisv, hf_gtp_ext_imeisv, next_tvb, 0, -1, digit_str);
proto_item_append_text(te, ": %s", digit_str);
@@ -5932,7 +5932,7 @@ decode_gtp_tmgi(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tr
ti = proto_tree_add_item(ext_tree, hf_gtp_tmgi, tvb, offset, length, ENC_NA);
tmgi_tree = proto_item_add_subtree(ti, ett_gtp_tmgi);
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
de_mid(next_tvb, tmgi_tree, pinfo, 0, length, NULL, 0);
return 3 + length;
@@ -6101,7 +6101,7 @@ decode_gtp_mbms_sa(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree *
offset++;
proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
offset = offset + 2;
- next_tvb = tvb_new_subset(tvb, offset, length-3, length-3);
+ next_tvb = tvb_new_subset_length(tvb, offset, length-3);
dissect_gtp_3gpp_mbms_service_area(next_tvb, pinfo, ext_tree, NULL);
return 3 + length;
@@ -7798,7 +7798,7 @@ decode_gtp_priv_ext(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree
offset = offset + 2;
if (length > 2) {
- next_tvb = tvb_new_subset(tvb, offset, length-2, length-2);
+ next_tvb = tvb_new_subset_length(tvb, offset, length-2);
if(!dissector_try_uint(gtp_priv_ext_dissector_table, ext_id, next_tvb, pinfo, ext_tree_priv_ext)){
proto_tree_add_item(ext_tree_priv_ext, hf_gtp_ext_val, tvb, offset, length - 2, ENC_NA);
}
diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c
index 7de0afc560..819633e493 100644
--- a/epan/dissectors/packet-gtpv2.c
+++ b/epan/dissectors/packet-gtpv2.c
@@ -1106,7 +1106,7 @@ dissect_gtpv2_stn_sr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_
int offset = 0;
stn_sr_item = proto_tree_add_item(tree, hf_gtpv2_stn_sr, tvb, offset, length, ENC_NA);
- new_tvb = tvb_new_subset(tvb, offset, length, length );
+ new_tvb = tvb_new_subset_length(tvb, offset, length);
sub_tree = proto_item_add_subtree(stn_sr_item, ett_gtpv2_stn_sr);
/* Octet 5
@@ -2367,7 +2367,7 @@ dissect_gtpv2_bearer_ctx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_
proto_item_append_text(item, "[Grouped IE]");
grouped_tree = proto_item_add_subtree(item, ett_gtpv2_bearer_ctx);
- new_tvb = tvb_new_subset(tvb, offset, length, length );
+ new_tvb = tvb_new_subset_length(tvb, offset, length);
dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, 0, message_type);
}
@@ -3652,7 +3652,7 @@ dissect_gtpv2_PDN_conn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_,
proto_item_append_text(item, "[Grouped IE]");
grouped_tree = proto_item_add_subtree(item, ett_gtpv2_PDN_conn);
- new_tvb = tvb_new_subset(tvb, offset, length, length );
+ new_tvb = tvb_new_subset_length(tvb, offset, length);
dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, offset, message_type);
}
@@ -4507,7 +4507,7 @@ dissect_gtpv2_private_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre
proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(ext_id, &sminmpec_values_ext, "Unknown"), ext_id);
- next_tvb = tvb_new_subset(tvb, offset, length-2, length-2);
+ next_tvb = tvb_new_subset_length(tvb, offset, length-2);
if (dissector_try_uint_new(gtpv2_priv_ext_dissector_table, ext_id, next_tvb, pinfo, tree, FALSE, GUINT_TO_POINTER((guint32)instance))){
return;
}
@@ -5340,7 +5340,7 @@ dissect_gtpv2(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
offset += 1;
if (p_flag) {
- msg_tvb = tvb_new_subset(tvb, 0, msg_length + 4, msg_length + 4);
+ msg_tvb = tvb_new_subset_length(tvb, 0, msg_length + 4);
dissect_gtpv2_ie_common(msg_tvb, pinfo, gtpv2_tree, offset, message_type);
} else {
dissect_gtpv2_ie_common(tvb, pinfo, gtpv2_tree, offset, message_type);
diff --git a/epan/dissectors/packet-h223.c b/epan/dissectors/packet-h223.c
index 1c5180933e..6b70fcc1a3 100644
--- a/epan/dissectors/packet-h223.c
+++ b/epan/dissectors/packet-h223.c
@@ -689,7 +689,7 @@ dissect_mux_al_pdu( tvbuff_t *tvb, packet_info *pinfo, proto_tree *vc_tree,
data_start++;
}
- next_tvb = tvb_new_subset( tvb, data_start, len-1-data_start, len-1-data_start );
+ next_tvb = tvb_new_subset_length( tvb, data_start, len-1-data_start);
al_subitem = proto_tree_add_item(al_tree, hf_h223_al_payload, next_tvb, 0, -1, ENC_NA);
calc_checksum = h223_al2_crc8bit(tvb);
@@ -885,7 +885,7 @@ dissect_mux_payload_by_me_list( tvbuff_t *tvb, packet_info *pinfo,
frag_len = me->repeat_count;
if(frag_len > 0) {
tvbuff_t *next_tvb;
- next_tvb = tvb_new_subset(tvb, offset, frag_len, frag_len);
+ next_tvb = tvb_new_subset_length(tvb, offset, frag_len);
dissect_mux_sdu_fragment( next_tvb, pinfo, pkt_offset + offset, pdu_tree,
call_info, me->vc, (offset+frag_len==len) && endOfMuxSdu);
offset += frag_len;
@@ -1072,7 +1072,7 @@ dissect_mux_pdu( tvbuff_t *tvb, packet_info *pinfo, guint32 pkt_offset,
dissected as data. */
len -= mpl;
if( len > 0 ) {
- tvbuff_t *next_tvb = tvb_new_subset(tvb, offset, len, len);
+ tvbuff_t *next_tvb = tvb_new_subset_length(tvb, offset, len);
proto_tree *vc_tree = NULL;
if( pdu_tree ) {
@@ -1253,8 +1253,7 @@ dissect_mux_pdu_fragment( tvbuff_t *tvb, guint32 start_offset,
}
/* create a tvb for the fragment */
- next_tvb = tvb_new_subset(tvb, start_offset, offset-start_offset,
- offset-start_offset);
+ next_tvb = tvb_new_subset_length(tvb, start_offset, offset-start_offset);
/*
* Dissect the PDU.
diff --git a/epan/dissectors/packet-h248.c b/epan/dissectors/packet-h248.c
index b09fe3f981..d646e4c050 100644
--- a/epan/dissectors/packet-h248.c
+++ b/epan/dissectors/packet-h248.c
@@ -1678,7 +1678,7 @@ static int dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int
return end_offset;
}
- next_tvb = tvb_new_subset(tvb,offset,len,len);
+ next_tvb = tvb_new_subset_length(tvb,offset,len);
name_minor = packageandid & 0xffff;
@@ -1760,7 +1760,7 @@ static int dissect_h248_SigParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb,
return end_offset;
}
- next_tvb = tvb_new_subset(tvb,offset,len,len);
+ next_tvb = tvb_new_subset_length(tvb,offset,len);
if ( curr_info.par && curr_info.par->dissector) {
curr_info.par->dissector(tree, next_tvb, actx->pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data);
@@ -1838,7 +1838,7 @@ static int dissect_h248_EventParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb
return end_offset;
}
- next_tvb = tvb_new_subset(tvb,offset,len,len);
+ next_tvb = tvb_new_subset_length(tvb,offset,len);
if ( curr_info.par && curr_info.par->dissector) {
curr_info.par->dissector(tree, next_tvb, actx->pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data);
diff --git a/epan/dissectors/packet-hdmi.c b/epan/dissectors/packet-hdmi.c
index 7decab1823..f9bdd94c0a 100644
--- a/epan/dissectors/packet-hdmi.c
+++ b/epan/dissectors/packet-hdmi.c
@@ -213,11 +213,9 @@ dissect_hdmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
offset++;
if (HDCP_ADDR8(addr)) {
- gint hdcp_len;
tvbuff_t *hdcp_tvb;
- hdcp_len = tvb_reported_length_remaining(tvb, offset);
- hdcp_tvb = tvb_new_subset(tvb, offset, hdcp_len, hdcp_len);
+ hdcp_tvb = tvb_new_subset_remaining(tvb, offset);
return call_dissector(hdcp_handle, hdcp_tvb, pinfo, hdmi_tree);
}
diff --git a/epan/dissectors/packet-hpfeeds.c b/epan/dissectors/packet-hpfeeds.c
index 7b05c2cef9..4d45cf3190 100644
--- a/epan/dissectors/packet-hpfeeds.c
+++ b/epan/dissectors/packet-hpfeeds.c
@@ -205,7 +205,7 @@ dissect_hpfeeds_publish_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
case CH_KIPPO_SESSIONS:
case CH_GLASTOPF_EVENTS:
case CH_GEOLOC_EVENTS:
- json_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ json_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(json_hdl, json_tvb, pinfo, tree);
break;
default:
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index b40f72bb7b..e652e3293a 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -1747,7 +1747,7 @@ chunked_encoding_dissector(tvbuff_t **tvb_ptr, packet_info *pinfo,
chunk_offset - offset, "Chunk size: %u octets",
chunk_size);
- data_tvb = tvb_new_subset(tvb, chunk_offset, chunk_size, chunk_size);
+ data_tvb = tvb_new_subset_length(tvb, chunk_offset, chunk_size);
/*
diff --git a/epan/dissectors/packet-ieee17221.c b/epan/dissectors/packet-ieee17221.c
index 343d78a358..3a2e30761b 100644
--- a/epan/dissectors/packet-ieee17221.c
+++ b/epan/dissectors/packet-ieee17221.c
@@ -3230,7 +3230,7 @@ dissect_17221_aem(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
STREAM_OFFSET_STREAM_FLAGS, 2, ENC_BIG_ENDIAN);
/* done adding flags, continue with fields */
/* stream format dissection */
- next_tvb = tvb_new_subset(tvb, STREAM_OFFSET_CURRENT_FORMAT, 8, 8);
+ next_tvb = tvb_new_subset_length(tvb, STREAM_OFFSET_CURRENT_FORMAT, 8);
dissect_17221_stream_format(next_tvb, aem_tree);
proto_tree_add_item(aem_tree, hf_aem_formats_offset, tvb,
@@ -3268,7 +3268,7 @@ dissect_17221_aem(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
mr_subtree = proto_item_add_subtree(mr_item, ett_aem_stream_formats);
for(i = 0; i < mr_counter; ++i) {
- next_tvb = tvb_new_subset(tvb, mr_offset, 8, 8);
+ next_tvb = tvb_new_subset_length(tvb, mr_offset, 8);
dissect_17221_stream_format(next_tvb, mr_subtree);
mr_offset += 8;
}
@@ -3921,7 +3921,7 @@ dissect_17221_aecp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aecp_tree)
if ((mess_type != AECP_AEM_COMMAND_MESSAGE)||(c_type == AECP_COMMAND_SET_STREAM_FORMAT))
{
- next_tvb = tvb_new_subset(tvb, AECP_OFFSET_STREAM_FORMAT_STREAM_FORMAT, 8, 8);
+ next_tvb = tvb_new_subset_length(tvb, AECP_OFFSET_STREAM_FORMAT_STREAM_FORMAT, 8);
dissect_17221_stream_format(next_tvb, aecp_tree);
}
break;
@@ -3934,16 +3934,16 @@ dissect_17221_aecp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aecp_tree)
if ((mess_type != AECP_AEM_COMMAND_MESSAGE)||(c_type == AECP_COMMAND_SET_VIDEO_FORMAT))
{
- next_tvb = tvb_new_subset(tvb, AECP_OFFSET_VIDEO_FORMAT_FORMAT_SPECIFIC, 4, 4);
+ next_tvb = tvb_new_subset_length(tvb, AECP_OFFSET_VIDEO_FORMAT_FORMAT_SPECIFIC, 4);
dissect_17221_video_format(next_tvb, aecp_tree);
- next_tvb = tvb_new_subset(tvb, AECP_OFFSET_VIDEO_FORMAT_ASPECT_RATIO, 2, 2);
+ next_tvb = tvb_new_subset_length(tvb, AECP_OFFSET_VIDEO_FORMAT_ASPECT_RATIO, 2);
dissect_17221_video_aspect_ratio(next_tvb, aecp_tree);
proto_tree_add_item(aecp_tree, hf_aem_color_space, tvb,
AECP_OFFSET_VIDEO_FORMAT_COLOR_SPACE, 2, ENC_BIG_ENDIAN);
- next_tvb = tvb_new_subset(tvb, AECP_OFFSET_VIDEO_FORMAT_FRAME_SIZE, 4, 4);
+ next_tvb = tvb_new_subset_length(tvb, AECP_OFFSET_VIDEO_FORMAT_FRAME_SIZE, 4);
dissect_17221_video_frame_size(next_tvb, aecp_tree);
}
break;
@@ -3956,7 +3956,7 @@ dissect_17221_aecp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aecp_tree)
if ((mess_type != AECP_AEM_COMMAND_MESSAGE)||(c_type == AECP_COMMAND_SET_SENSOR_FORMAT))
{
- next_tvb = tvb_new_subset(tvb, AECP_OFFSET_SENSOR_FORMAT_SENSOR_FORMAT, 8, 8);
+ next_tvb = tvb_new_subset_length(tvb, AECP_OFFSET_SENSOR_FORMAT_SENSOR_FORMAT, 8);
dissect_17221_sensor_format(next_tvb, aecp_tree);
}
break;
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index f72b25b373..41014bb2a8 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -14392,7 +14392,7 @@ add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset
offset += 2;
oui = tvb_get_ntoh24(tvb, offset);
- tag_tvb = tvb_new_subset(tvb, offset, tag_len, tag_len);
+ tag_tvb = tvb_new_subset_length(tvb, offset, tag_len);
proto_tree_add_item(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_NA);
proto_item_append_text(ti, ": %s", uint_get_manuf_name(oui));
offset += 3;
diff --git a/epan/dissectors/packet-ifcp.c b/epan/dissectors/packet-ifcp.c
index ff044e2ea5..8f253f50f5 100644
--- a/epan/dissectors/packet-ifcp.c
+++ b/epan/dissectors/packet-ifcp.c
@@ -487,7 +487,7 @@ dissect_ifcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
}
}
- next_tvb=tvb_new_subset(tvb, offset, frame_len-offset-4, frame_len-offset-4);
+ next_tvb=tvb_new_subset_length(tvb, offset, frame_len-offset-4);
fc_data.ethertype = 0;
if(fc_handle){
diff --git a/epan/dissectors/packet-ipdc.c b/epan/dissectors/packet-ipdc.c
index 89b8cd7343..3575502dfd 100644
--- a/epan/dissectors/packet-ipdc.c
+++ b/epan/dissectors/packet-ipdc.c
@@ -911,7 +911,7 @@ dissect_ipdc_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
break;
case IPDC_Q931:
q931_tvb =
- tvb_new_subset(tvb, offset+2, len, len);
+ tvb_new_subset_length(tvb, offset+2, len);
call_dissector(q931_handle,q931_tvb,pinfo,tree);
break;
case IPDC_ENCTYPE:
diff --git a/epan/dissectors/packet-ipmi-se.c b/epan/dissectors/packet-ipmi-se.c
index b464a00316..cce9319bab 100644
--- a/epan/dissectors/packet-ipmi-se.c
+++ b/epan/dissectors/packet-ipmi-se.c
@@ -1841,7 +1841,7 @@ parse_platform_event(tvbuff_t *tvb, proto_tree *tree)
return;
}
- next_tvb = tvb_new_subset(tvb, 5, 1, 1);
+ next_tvb = tvb_new_subset_length(tvb, 5, 1);
d = tvb_get_guint8(next_tvb, 0);
if ((eti->intrp2 && eti->intrp2(tree, next_tvb, si, b2, offs, d))
|| (si->intrp2 && si->intrp2(tree, next_tvb, si, b2, offs, d))) {
@@ -1858,7 +1858,7 @@ parse_platform_event(tvbuff_t *tvb, proto_tree *tree)
return;
}
- next_tvb = tvb_new_subset(tvb, 6, 1, 1);
+ next_tvb = tvb_new_subset_length(tvb, 6, 1);
d = tvb_get_guint8(next_tvb, 0);
if ((eti->intrp3 && eti->intrp3(tree, next_tvb, si, b3, offs, d))
|| (si->intrp3 && si->intrp3(tree, next_tvb, si, b3, offs, d))) {
diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c
index 8b815ed220..3576b146c0 100644
--- a/epan/dissectors/packet-ipsec.c
+++ b/epan/dissectors/packet-ipsec.c
@@ -1958,8 +1958,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (dissector_handle) {
saved_match_uint = pinfo->match_uint;
pinfo->match_uint = encapsulated_protocol;
- next_tvb = tvb_new_subset(tvb_decrypted, 0,
- decrypted_len - esp_auth_len - esp_pad_len - esp_iv_len - 2,
+ next_tvb = tvb_new_subset_length(tvb_decrypted, 0,
decrypted_len - esp_auth_len - esp_pad_len - esp_iv_len - 2);
export_ipsec_pdu(dissector_handle, pinfo, next_tvb);
call_dissector(dissector_handle, next_tvb, pinfo, tree);
@@ -2001,8 +2000,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
else
{
- next_tvb = tvb_new_subset(tvb_decrypted, 0,
- decrypted_len - esp_iv_len - esp_auth_len,
+ next_tvb = tvb_new_subset_length(tvb_decrypted, 0,
decrypted_len - esp_iv_len - esp_auth_len);
export_ipsec_pdu(data_handle, pinfo, next_tvb);
call_dissector(data_handle, next_tvb, pinfo, esp_tree);
diff --git a/epan/dissectors/packet-isakmp.c b/epan/dissectors/packet-isakmp.c
index b9fe3310d4..c99cab4aed 100644
--- a/epan/dissectors/packet-isakmp.c
+++ b/epan/dissectors/packet-isakmp.c
@@ -4834,7 +4834,7 @@ dissect_eap(tvbuff_t *tvb, int offset, int length, proto_tree *tree, packet_info
{
tvbuff_t *eap_tvb = NULL;
- eap_tvb = tvb_new_subset(tvb, offset,length, length );
+ eap_tvb = tvb_new_subset_length(tvb, offset, length);
if ((eap_tvb != NULL)&& eap_handle != NULL){
call_dissector(eap_handle, eap_tvb, pinfo, tree);
}else{
diff --git a/epan/dissectors/packet-isl.c b/epan/dissectors/packet-isl.c
index 4ee2a58437..e580cd4a5a 100644
--- a/epan/dissectors/packet-isl.c
+++ b/epan/dissectors/packet-isl.c
@@ -195,7 +195,7 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int fcs_len)
the data specified by the length field. */
TRY {
- payload_tvb = tvb_new_subset(tvb, 14, length, length);
+ payload_tvb = tvb_new_subset_length(tvb, 14, length);
trailer_tvb = tvb_new_subset_remaining(tvb, 14 + length);
}
CATCH_BOUNDS_ERRORS {
diff --git a/epan/dissectors/packet-isup.c b/epan/dissectors/packet-isup.c
index ecc5caf407..09a647cb1c 100644
--- a/epan/dissectors/packet-isup.c
+++ b/epan/dissectors/packet-isup.c
@@ -4795,7 +4795,7 @@ dissect_bat_ase_Encapsulated_Application_Information(tvbuff_t *parameter_tvb, pa
/* If this is a segmented message we may not have all the data */
next_tvb = tvb_new_subset_remaining(parameter_tvb, offset);
} else {
- next_tvb = tvb_new_subset(parameter_tvb, offset, sdp_length, sdp_length);
+ next_tvb = tvb_new_subset_length(parameter_tvb, offset, sdp_length);
}
if (BCTP_Indicator_field_2==0x20) {
/* IPBCP (text encoded) */
diff --git a/epan/dissectors/packet-iua.c b/epan/dissectors/packet-iua.c
index aec363056c..c323753033 100644
--- a/epan/dissectors/packet-iua.c
+++ b/epan/dissectors/packet-iua.c
@@ -421,7 +421,7 @@ dissect_protocol_data_parameter(tvbuff_t *parameter_tvb, proto_item *parameter_i
tvbuff_t *protocol_data_tvb;
protocol_data_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
- protocol_data_tvb = tvb_new_subset(parameter_tvb, PROTOCOL_DATA_OFFSET, protocol_data_length, protocol_data_length);
+ protocol_data_tvb = tvb_new_subset_length(parameter_tvb, PROTOCOL_DATA_OFFSET, protocol_data_length);
proto_item_append_text(parameter_item, " (%u byte%s)", protocol_data_length, plurality(protocol_data_length, "", "s"));
if(sapi_val_assigned == FALSE)
@@ -659,7 +659,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, packet_info *pinfo, proto_tree *tre
if (remaining_length >= length)
total_length = MIN(total_length, remaining_length);
/* create a tvb for the parameter including the padding bytes */
- parameter_tvb = tvb_new_subset(parameters_tvb, offset, total_length, total_length);
+ parameter_tvb = tvb_new_subset_length(parameters_tvb, offset, total_length);
dissect_parameter(parameter_tvb, pinfo, tree, iua_tree);
/* get rid of the handled parameter */
offset += total_length;
@@ -889,7 +889,7 @@ dissect_iua_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree,
sapi_val_assigned = FALSE;
- common_header_tvb = tvb_new_subset(message_tvb, COMMON_HEADER_OFFSET, COMMON_HEADER_LENGTH, COMMON_HEADER_LENGTH);
+ common_header_tvb = tvb_new_subset_length(message_tvb, COMMON_HEADER_OFFSET, COMMON_HEADER_LENGTH);
parameters_tvb = tvb_new_subset_remaining(message_tvb, PARAMETERS_OFFSET);
dissect_common_header(common_header_tvb, pinfo, iua_tree);
dissect_parameters(parameters_tvb, pinfo, tree, iua_tree);
diff --git a/epan/dissectors/packet-iuup.c b/epan/dissectors/packet-iuup.c
index d826263d3e..968397cf58 100644
--- a/epan/dissectors/packet-iuup.c
+++ b/epan/dissectors/packet-iuup.c
@@ -623,7 +623,7 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
pinfo->circuit_id = phdr;
- tvb = tvb_new_subset(tvb_in,2,len,len);
+ tvb = tvb_new_subset_length(tvb_in,2,len);
}
first_octet = tvb_get_guint8(tvb,0);
diff --git a/epan/dissectors/packet-iwarp-mpa.c b/epan/dissectors/packet-iwarp-mpa.c
index 97aac2d850..f7364c84c7 100644
--- a/epan/dissectors/packet-iwarp-mpa.c
+++ b/epan/dissectors/packet-iwarp-mpa.c
@@ -831,14 +831,13 @@ dissect_iwarp_mpa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
/* removes Markers if any and prepares new tvbuff for next dissector */
if (endpoint <= MPA_RESPONDER && state->minfo[endpoint].valid
&& number_of_markers(state, tcpinfo, endpoint) > 0) {
- next_tvb = tvb_new_subset(remove_markers(tvb, pinfo,
+ next_tvb = tvb_new_subset_length(remove_markers(tvb, pinfo,
get_first_marker_offset(state, tcpinfo, endpoint),
number_of_markers(state, tcpinfo, endpoint),
fpdu_total_length(tcpinfo)), MPA_ULPDU_LENGTH_LEN,
- ulpdu_length, ulpdu_length);
- } else {
- next_tvb = tvb_new_subset(tvb, MPA_ULPDU_LENGTH_LEN, ulpdu_length,
ulpdu_length);
+ } else {
+ next_tvb = tvb_new_subset_length(tvb, MPA_ULPDU_LENGTH_LEN, ulpdu_length);
}
diff --git a/epan/dissectors/packet-ixveriwave.c b/epan/dissectors/packet-ixveriwave.c
index d17a08ff37..8ff1fe4915 100644
--- a/epan/dissectors/packet-ixveriwave.c
+++ b/epan/dissectors/packet-ixveriwave.c
@@ -513,7 +513,7 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Grab the rest of the frame. */
- next_tvb = tvb_new_subset(tvb, length, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, length);
/* dissect the ethernet or wlan header next */
if (version == ETHERNET_PORT)
@@ -672,7 +672,7 @@ ethernettap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_t
}
/* Grab the rest of the frame. */
- next_tvb = tvb_new_subset(tvb, length, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, length);
/* dissect the ethernet header next */
call_dissector(ethernet_handle, next_tvb, pinfo, tree);
@@ -953,7 +953,7 @@ wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
pinfo->pseudo_header->ieee_802_11.fcs_len = 0;
/* Grab the rest of the frame. */
- next_tvb = tvb_new_subset(tvb, length, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, length);
/* If we had an in-header FCS, check it. */
if (hdr_fcs_ti) {
diff --git a/epan/dissectors/packet-jxta.c b/epan/dissectors/packet-jxta.c
index 2ee53e241a..0fd5d1a6c1 100644
--- a/epan/dissectors/packet-jxta.c
+++ b/epan/dissectors/packet-jxta.c
@@ -479,7 +479,7 @@ static int dissect_jxta_udp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr
tree_offset += dissect_jxta_message_framing(jxta_message_framing_tvb, pinfo, jxta_tree, &content_length, &content_type);
- jxta_message_tvb = tvb_new_subset(tvb, tree_offset, (gint) content_length, (gint) content_length);
+ jxta_message_tvb = tvb_new_subset_length(tvb, tree_offset, (gint) content_length);
tree_offset += dissect_media(content_type, jxta_message_tvb, pinfo, tree);
@@ -601,7 +601,7 @@ static int dissect_jxta_stream(tvbuff_t * tvb, packet_info * pinfo, proto_tree *
available = tvb_reported_length_remaining(tvb, offset + headers_len);
if (available >= content_length) {
- tvbuff_t *jxta_message_tvb = tvb_new_subset(tvb, offset + headers_len, (gint) content_length, (gint) content_length);
+ tvbuff_t *jxta_message_tvb = tvb_new_subset_length(tvb, offset + headers_len, (gint) content_length);
conversation_t *peer_conversation = NULL;
jxta_tree_item = proto_tree_add_protocol_format(tree, proto_jxta, tvb, offset, -1, "JXTA" );
@@ -1653,7 +1653,7 @@ static int dissect_jxta_message_element_1(tvbuff_t * tvb, packet_info * pinfo, p
proto_tree_add_item(jxta_elem_tree, hf_jxta_element_content_len, tvb, tree_offset, (int)sizeof(guint32), ENC_BIG_ENDIAN);
tree_offset += (int)sizeof(guint32);
- element_content_tvb = tvb_new_subset(tvb, tree_offset, content_len, content_len);
+ element_content_tvb = tvb_new_subset_length(tvb, tree_offset, content_len);
tree_offset += dissect_media(mediatype, element_content_tvb, pinfo, jxta_elem_tree);
@@ -1951,7 +1951,7 @@ static int dissect_jxta_message_element_2(tvbuff_t * tvb, packet_info * pinfo, p
}
/* content */
- element_content_tvb = tvb_new_subset(tvb, tree_offset, (gint)content_len, (gint)content_len);
+ element_content_tvb = tvb_new_subset_length(tvb, tree_offset, (gint)content_len);
tree_offset += dissect_media(mediatype, element_content_tvb, pinfo, jxta_elem_tree);
diff --git a/epan/dissectors/packet-kafka.c b/epan/dissectors/packet-kafka.c
index afb4900d41..1ae8649a49 100644
--- a/epan/dissectors/packet-kafka.c
+++ b/epan/dissectors/packet-kafka.c
@@ -236,7 +236,7 @@ kafka_get_bytes(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int off
return NULL;
}
else {
- return tvb_new_subset(tvb, offset, len, len);
+ return tvb_new_subset_length(tvb, offset, len);
}
}
diff --git a/epan/dissectors/packet-kpasswd.c b/epan/dissectors/packet-kpasswd.c
index c1e9f87b4a..f51cd7d8ef 100644
--- a/epan/dissectors/packet-kpasswd.c
+++ b/epan/dissectors/packet-kpasswd.c
@@ -222,7 +222,7 @@ dissect_kpasswd_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboo
offset+=6;
/* AP-REQ / AP-REP data */
- next_tvb=tvb_new_subset(tvb, offset, ap_req_len, ap_req_len);
+ next_tvb=tvb_new_subset_length(tvb, offset, ap_req_len);
dissect_kpasswd_ap_req_data(pinfo, next_tvb, kpasswd_tree);
offset+=ap_req_len;
diff --git a/epan/dissectors/packet-l2tp.c b/epan/dissectors/packet-l2tp.c
index 830ac7c278..8a4047600c 100644
--- a/epan/dissectors/packet-l2tp.c
+++ b/epan/dissectors/packet-l2tp.c
@@ -1534,7 +1534,7 @@ static void process_control_avps(tvbuff_t *tvb,
if (avp_vendor_id != VENDOR_IETF) {
- avp_tvb = tvb_new_subset(tvb, idx, avp_len, avp_len);
+ avp_tvb = tvb_new_subset_length(tvb, idx, avp_len);
if (avp_vendor_id == VENDOR_CISCO) { /* Vendor-Specific AVP */
@@ -1783,21 +1783,21 @@ static void process_control_avps(tvbuff_t *tvb,
case INITIAL_RECEIVED_LCP_CONFREQ:
te = proto_tree_add_item(l2tp_avp_tree, hf_l2tp_avp_initial_received_lcp_confreq, tvb, idx, avp_len, ENC_NA);
l2tp_lcp_avp_tree = proto_item_add_subtree(te, ett_l2tp_lcp);
- next_tvb = tvb_new_subset(tvb, idx, avp_len, avp_len);
+ next_tvb = tvb_new_subset_length(tvb, idx, avp_len);
call_dissector(ppp_lcp_options_handle, next_tvb, pinfo, l2tp_lcp_avp_tree );
break;
case LAST_SENT_LCP_CONFREQ:
te = proto_tree_add_item(l2tp_avp_tree, hf_l2tp_avp_last_sent_lcp_confreq, tvb, idx, avp_len, ENC_NA);
l2tp_lcp_avp_tree = proto_item_add_subtree(te, ett_l2tp_lcp);
- next_tvb = tvb_new_subset(tvb, idx, avp_len, avp_len);
+ next_tvb = tvb_new_subset_length(tvb, idx, avp_len);
call_dissector(ppp_lcp_options_handle, next_tvb, pinfo, l2tp_lcp_avp_tree );
break;
case LAST_RECEIVED_LCP_CONFREQ:
te = proto_tree_add_item(l2tp_avp_tree, hf_l2tp_avp_last_received_lcp_confreq, tvb, idx, avp_len, ENC_NA);
l2tp_lcp_avp_tree = proto_item_add_subtree(te, ett_l2tp_lcp);
- next_tvb = tvb_new_subset(tvb, idx, avp_len, avp_len);
+ next_tvb = tvb_new_subset_length(tvb, idx, avp_len);
call_dissector(ppp_lcp_options_handle, next_tvb, pinfo, l2tp_lcp_avp_tree );
break;
diff --git a/epan/dissectors/packet-lapbether.c b/epan/dissectors/packet-lapbether.c
index 2486169ed5..611d460d45 100644
--- a/epan/dissectors/packet-lapbether.c
+++ b/epan/dissectors/packet-lapbether.c
@@ -62,7 +62,7 @@ dissect_lapbether(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
- next_tvb = tvb_new_subset(tvb, 2, len, len);
+ next_tvb = tvb_new_subset_length(tvb, 2, len);
call_dissector(lapb_handle, next_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-lapd.c b/epan/dissectors/packet-lapd.c
index 36f7f2fce1..ecfa566505 100644
--- a/epan/dissectors/packet-lapd.c
+++ b/epan/dissectors/packet-lapd.c
@@ -560,7 +560,7 @@ dissect_lapd_full(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
expert_add_info(pinfo, pi, &ei_lapd_checksum_bad);
}
- next_tvb = tvb_new_subset(tvb, lapd_header_len, tvb_length_remaining(tvb,lapd_header_len) - 2, tvb_length_remaining(tvb,lapd_header_len) - 2);
+ next_tvb = tvb_new_subset_length(tvb, lapd_header_len, tvb_length_remaining(tvb,lapd_header_len) - 2);
} else
next_tvb = tvb_new_subset_remaining(tvb, lapd_header_len);
diff --git a/epan/dissectors/packet-lbmc.c b/epan/dissectors/packet-lbmc.c
index 7926271ae7..220a1e8a3a 100644
--- a/epan/dissectors/packet-lbmc.c
+++ b/epan/dissectors/packet-lbmc.c
@@ -10772,7 +10772,7 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr
return (len_dissected);
}
/* Create a new tvb for just this LBMC message. */
- lbmc_tvb = tvb_new_subset(tvb, tvb_lbmc_offset, (gint)msglen, (gint)msglen);
+ lbmc_tvb = tvb_new_subset_length(tvb, tvb_lbmc_offset, (gint)msglen);
if ((type == LBMC_TYPE_MESSAGE) || (type == LBMC_TYPE_RETRANS) || (type == LBMC_TYPE_PRORX))
{
topic_index = tvb_get_ntohl(lbmc_tvb, O_LBMC_HDR_T_TIDX);
@@ -10897,7 +10897,7 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr
expert_add_info_format(pinfo, NULL, &ei_lbmc_analysis_zero_length, "LBMC header length is zero");
return (len_dissected);
}
- hdr_tvb = tvb_new_subset(lbmc_tvb, pkt_offset, (gint)bhdr.hdr_len, (gint)bhdr.hdr_len);
+ hdr_tvb = tvb_new_subset_length(lbmc_tvb, pkt_offset, (gint)bhdr.hdr_len);
found_header[next_hdr] = 1;
switch (next_hdr)
{
@@ -11365,13 +11365,12 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr
/* Has message properties */
actual_data_len = tvb_reported_length_remaining(lbmc_tvb, pkt_offset) - msgprop_len;
msgprop_offset = pkt_offset + actual_data_len;
- data_tvb = tvb_new_subset(lbmc_tvb, pkt_offset, actual_data_len, actual_data_len);
- msgprop_tvb = tvb_new_subset(lbmc_tvb, msgprop_offset, msgprop_len, msgprop_len);
+ data_tvb = tvb_new_subset_length(lbmc_tvb, pkt_offset, actual_data_len);
+ msgprop_tvb = tvb_new_subset_length(lbmc_tvb, msgprop_offset, msgprop_len);
}
else
{
- actual_data_len = tvb_reported_length_remaining(lbmc_tvb, pkt_offset);
- data_tvb = tvb_new_subset(lbmc_tvb, pkt_offset, actual_data_len, actual_data_len);
+ data_tvb = tvb_new_subset_remaining(lbmc_tvb, pkt_offset);
msgprop_tvb = NULL;
}
msg_complete = TRUE;
@@ -11384,7 +11383,7 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr
{
/* But don't reassemble them */
actual_data_len = tvb_reported_length_remaining(lbmc_tvb, pkt_offset);
- data_tvb = tvb_new_subset(lbmc_tvb, pkt_offset, actual_data_len, actual_data_len);
+ data_tvb = tvb_new_subset_length(lbmc_tvb, pkt_offset, actual_data_len);
msgprop_tvb = NULL;
msg_complete = TRUE;
}
@@ -11421,8 +11420,7 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr
{
/* Store the frame number in which the message will be reassembled */
msg->reassembled_frame = pinfo->fd->num;
- actual_data_len = tvb_reported_length_remaining(lbmc_tvb, pkt_offset);
- data_tvb = tvb_new_subset(lbmc_tvb, pkt_offset, actual_data_len, actual_data_len);
+ data_tvb = tvb_new_subset_remaining(lbmc_tvb, pkt_offset);
msgprop_tvb = NULL;
msg_reassembled = TRUE;
msg_complete = TRUE;
@@ -11430,8 +11428,7 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr
else
{
/* This is not the last fragment of the message. */
- actual_data_len = tvb_reported_length_remaining(lbmc_tvb, pkt_offset);
- data_tvb = tvb_new_subset(lbmc_tvb, pkt_offset, actual_data_len, actual_data_len);
+ data_tvb = tvb_new_subset_remaining(lbmc_tvb, pkt_offset);
msgprop_tvb = NULL;
msg_reassembled = TRUE;
msg_complete = FALSE;
@@ -11468,21 +11465,21 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr
msg->reassembled_data = tvb_new_real_data(buf, msg->total_len, msg->total_len);
msg_complete = TRUE;
/* Create separate data and msgprop tvbs */
- msg->data = tvb_new_subset(msg->reassembled_data, 0, msg->total_len - msg->msgprop_len, msg->total_len - msg->msgprop_len);
+ msg->data = tvb_new_subset_length(msg->reassembled_data, 0, msg->total_len - msg->msgprop_len);
if (msg->msgprop_len > 0)
{
- msg->msgprop = tvb_new_subset(msg->reassembled_data, msg->total_len - msg->msgprop_len, msg->msgprop_len, msg->msgprop_len);
+ msg->msgprop = tvb_new_subset_length(msg->reassembled_data, msg->total_len - msg->msgprop_len, msg->msgprop_len);
}
add_new_data_source(pinfo, msg->reassembled_data, "Reassembled Data");
if (msg->data == NULL)
{
- msg->data = tvb_new_subset(msg->reassembled_data, 0, msg->total_len - msg->msgprop_len, msg->total_len - msg->msgprop_len);
+ msg->data = tvb_new_subset_length(msg->reassembled_data, 0, msg->total_len - msg->msgprop_len);
}
if (msg->msgprop == NULL)
{
if (msg->msgprop_len > 0)
{
- msg->msgprop = tvb_new_subset(msg->reassembled_data, msg->total_len - msg->msgprop_len, msg->msgprop_len, msg->msgprop_len);
+ msg->msgprop = tvb_new_subset_length(msg->reassembled_data, msg->total_len - msg->msgprop_len, msg->msgprop_len);
}
}
data_tvb = msg->data;
diff --git a/epan/dissectors/packet-lbmr.c b/epan/dissectors/packet-lbmr.c
index 398c3c01b1..80eb36a026 100644
--- a/epan/dissectors/packet-lbmr.c
+++ b/epan/dissectors/packet-lbmr.c
@@ -5290,7 +5290,7 @@ static int dissect_lbmr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
{
gint tvb_len = packet_len - opt_total_len;
- packet_tvb = tvb_new_subset(tvb, 0, tvb_len, tvb_len);
+ packet_tvb = tvb_new_subset_length(tvb, 0, tvb_len);
}
}
}
diff --git a/epan/dissectors/packet-lbtrm.c b/epan/dissectors/packet-lbtrm.c
index 7d4179ddb7..4d2b505ec1 100644
--- a/epan/dissectors/packet-lbtrm.c
+++ b/epan/dissectors/packet-lbtrm.c
@@ -886,7 +886,7 @@ static int dissect_lbtrm_data_contents(tvbuff_t * tvb, int offset, packet_info *
{
tvbuff_t * next_tvb;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
return (lbmc_dissect_lbmc_packet(next_tvb, 0, pinfo, tree, tag_name, channel));
}
diff --git a/epan/dissectors/packet-lbtru.c b/epan/dissectors/packet-lbtru.c
index c7c7eda9fa..1af694ea59 100644
--- a/epan/dissectors/packet-lbtru.c
+++ b/epan/dissectors/packet-lbtru.c
@@ -903,7 +903,7 @@ static int dissect_lbtru_data_contents(tvbuff_t * tvb, int offset, packet_info *
{
tvbuff_t * next_tvb;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
return (lbmc_dissect_lbmc_packet(next_tvb, 0, pinfo, tree, tag_name, channel));
}
diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c
index 536e52da41..1156c240b9 100644
--- a/epan/dissectors/packet-ldap.c
+++ b/epan/dissectors/packet-ldap.c
@@ -839,7 +839,7 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, as
char *tmpstr;
/* this octet string contains an NT SID */
- sid_tvb=tvb_new_subset(tvb, offset, len, len);
+ sid_tvb=tvb_new_subset_length(tvb, offset, len);
dissect_nt_sid(sid_tvb, 0, tree, "SID", &tmpstr, hf_index);
ldapvalue_string=tmpstr;
@@ -4129,10 +4129,7 @@ static void
/* if we could unwrap, do a tvb shuffle */
if(pinfo->gssapi_decrypted_tvb){
decr_tvb=pinfo->gssapi_decrypted_tvb;
- } else if (pinfo->gssapi_wrap_tvb) {
- plain_tvb=pinfo->gssapi_wrap_tvb;
}
-
/* tidy up */
pinfo->decrypt_gssapi_tvb=0;
pinfo->gssapi_wrap_tvb=NULL;
@@ -4152,7 +4149,7 @@ static void
* see if the wrapping involved encryption of the
* data; if not, just use the plaintext data.
*/
- if (!decr_tvb && !plain_tvb) {
+ if (!decr_tvb) {
if(!pinfo->gssapi_data_encrypted){
plain_tvb = tvb_new_subset_remaining(gssapi_tvb, ver_len);
}
diff --git a/epan/dissectors/packet-linx.c b/epan/dissectors/packet-linx.c
index 8464a64042..d756d13e27 100644
--- a/epan/dissectors/packet-linx.c
+++ b/epan/dissectors/packet-linx.c
@@ -339,7 +339,7 @@ dissect_linx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
version = (dword >> 25) & 0x7;
nexthdr = (dword >> 28) & 0xf;
pkgsize = dword & 0x3fff;
- linx_tvb = tvb_new_subset(tvb, 0, pkgsize, pkgsize);
+ linx_tvb = tvb_new_subset_length(tvb, 0, pkgsize);
tvb_set_reported_length(tvb, pkgsize);
/* Supports version 2 and 3 so far */
@@ -873,7 +873,7 @@ dissect_linx_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_append_fstr(pinfo->cinfo, COL_INFO, "tcpcm:%s ", val_to_str_const(type, linx_short_tcp_names, "unknown"));
tvb_set_reported_length(tvb, size);
- linx_tcp_tvb = tvb_new_subset(tvb, 0, size, size);
+ linx_tcp_tvb = tvb_new_subset_length(tvb, 0, size);
ti = proto_tree_add_item(tree, proto_linx_tcp, linx_tcp_tvb, 0, -1, ENC_NA);
linx_tcp_tree = proto_item_add_subtree(ti, ett_linx_tcp);
diff --git a/epan/dissectors/packet-lldp.c b/epan/dissectors/packet-lldp.c
index 330af0cb25..d73244bb9c 100644
--- a/epan/dissectors/packet-lldp.c
+++ b/epan/dissectors/packet-lldp.c
@@ -3295,7 +3295,7 @@ dissect_lldp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tempShort = tvb_get_ntohs(tvb, offset);
tempType = TLV_TYPE(tempShort);
/* pass only TLV to dissectors, Zero offset (point to front of tlv) */
- new_tvb = tvb_new_subset(tvb, offset, TLV_INFO_LEN(tempShort)+2, TLV_INFO_LEN(tempShort)+2);
+ new_tvb = tvb_new_subset_length(tvb, offset, TLV_INFO_LEN(tempShort)+2);
switch (tempType)
{
case CHASSIS_ID_TLV_TYPE:
diff --git a/epan/dissectors/packet-lte-rrc.c b/epan/dissectors/packet-lte-rrc.c
index d5a2a37170..fad45bd176 100644
--- a/epan/dissectors/packet-lte-rrc.c
+++ b/epan/dissectors/packet-lte-rrc.c
@@ -5327,7 +5327,7 @@ dissect_lte_rrc_warningMessageSegment(tvbuff_t *warning_msg_seg_tvb, proto_tree
}
for (i = 0, offset = 1; i < nb_of_pages; i++) {
length = tvb_get_guint8(warning_msg_seg_tvb, offset+82);
- cb_data_page_tvb = tvb_new_subset(warning_msg_seg_tvb, offset, length, length);
+ cb_data_page_tvb = tvb_new_subset_length(warning_msg_seg_tvb, offset, length);
cb_data_tvb = dissect_cbs_data(dataCodingScheme, cb_data_page_tvb, tree, pinfo, 0);
if (cb_data_tvb) {
str = tvb_get_string_enc(wmem_packet_scope(), cb_data_tvb, 0, tvb_reported_length(cb_data_tvb), ENC_UTF_8|ENC_NA);
diff --git a/epan/dissectors/packet-ltp.c b/epan/dissectors/packet-ltp.c
index 5316f8b8e0..4738ab7813 100644
--- a/epan/dissectors/packet-ltp.c
+++ b/epan/dissectors/packet-ltp.c
@@ -341,7 +341,7 @@ dissect_data_segment(proto_tree *ltp_tree, tvbuff_t *tvb,packet_info *pinfo,int
/* if the segment has not been fragmented, then no reassembly is needed */
if(!more_frags && offset == 0)
{
- new_tvb = tvb_new_subset(tvb,frame_offset,tvb_length(tvb)-frame_offset,-1);
+ new_tvb = tvb_new_subset_remaining(tvb,frame_offset);
}
else
{
diff --git a/epan/dissectors/packet-m2pa.c b/epan/dissectors/packet-m2pa.c
index a57d02cbb0..7ffc180867 100644
--- a/epan/dissectors/packet-m2pa.c
+++ b/epan/dissectors/packet-m2pa.c
@@ -398,7 +398,7 @@ dissect_v2_message_data(tvbuff_t *message_tvb, packet_info *pinfo, proto_item *m
THROW(ReportedBoundsError);
}
- message_data_tvb = tvb_new_subset(message_tvb, V2_MESSAGE_DATA_OFFSET, message_data_length, message_data_length);
+ message_data_tvb = tvb_new_subset_length(message_tvb, V2_MESSAGE_DATA_OFFSET, message_data_length);
type = tvb_get_ntohs(message_tvb, V2_TYPE_OFFSET);
switch(type) {
@@ -429,7 +429,7 @@ dissect_v8_message_data(tvbuff_t *message_tvb, packet_info *pinfo, proto_item *m
"Invalid message data length: %u", message_data_length);
THROW(ReportedBoundsError);
}
- message_data_tvb = tvb_new_subset(message_tvb, V8_MESSAGE_DATA_OFFSET, message_data_length, message_data_length);
+ message_data_tvb = tvb_new_subset_length(message_tvb, V8_MESSAGE_DATA_OFFSET, message_data_length);
type = tvb_get_guint8(message_tvb, V8_TYPE_OFFSET);
@@ -456,7 +456,7 @@ dissect_message_data(tvbuff_t *message_tvb, packet_info *pinfo, proto_item *m2pa
length = tvb_get_ntohl(message_tvb, LENGTH_OFFSET);
message_data_length = length - HEADER_LENGTH;
- message_data_tvb = tvb_new_subset(message_tvb, MESSAGE_DATA_OFFSET, message_data_length, message_data_length);
+ message_data_tvb = tvb_new_subset_length(message_tvb, MESSAGE_DATA_OFFSET, message_data_length);
type = tvb_get_guint8(message_tvb, TYPE_OFFSET);
diff --git a/epan/dissectors/packet-m2tp.c b/epan/dissectors/packet-m2tp.c
index a8880459dc..025a4f2b27 100644
--- a/epan/dissectors/packet-m2tp.c
+++ b/epan/dissectors/packet-m2tp.c
@@ -406,7 +406,7 @@ dissect_m2tp_protocol_data_parameter(tvbuff_t *parameter_tvb, proto_tree *parame
padding_length = nr_of_padding_bytes(length);
protocol_data_length = length - PARAMETER_HEADER_LENGTH;
- mtp2_tvb = tvb_new_subset(parameter_tvb, PARAMETER_VALUE_OFFSET, protocol_data_length, protocol_data_length);
+ mtp2_tvb = tvb_new_subset_length(parameter_tvb, PARAMETER_VALUE_OFFSET, protocol_data_length);
call_dissector(mtp2_handle, mtp2_tvb, pinfo, tree);
if (parameter_tree) {
@@ -507,7 +507,7 @@ dissect_m2tp_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_item *m2tp
offset = 0;
/* extract and process the common header */
- common_header_tvb = tvb_new_subset(message_tvb, offset, COMMON_HEADER_LENGTH, COMMON_HEADER_LENGTH);
+ common_header_tvb = tvb_new_subset_length(message_tvb, offset, COMMON_HEADER_LENGTH);
dissect_m2tp_common_header(common_header_tvb, pinfo, m2tp_tree);
offset += COMMON_HEADER_LENGTH;
@@ -517,7 +517,7 @@ dissect_m2tp_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_item *m2tp
padding_length = nr_of_padding_bytes(length);
total_length = length + padding_length;
/* create a tvb for the parameter including the padding bytes */
- parameter_tvb = tvb_new_subset(message_tvb, offset, total_length, total_length);
+ parameter_tvb = tvb_new_subset_length(message_tvb, offset, total_length);
dissect_m2tp_parameter(parameter_tvb, pinfo, m2tp_tree, m2tp_item, tree);
/* get rid of the handled parameter */
offset += total_length;
diff --git a/epan/dissectors/packet-m2ua.c b/epan/dissectors/packet-m2ua.c
index fea7ae4d94..c869e1db09 100644
--- a/epan/dissectors/packet-m2ua.c
+++ b/epan/dissectors/packet-m2ua.c
@@ -500,7 +500,7 @@ dissect_protocol_data_1_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, p
payload_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
- payload_tvb = tvb_new_subset(parameter_tvb, DATA_1_MTP3_OFFSET, payload_length, payload_length);
+ payload_tvb = tvb_new_subset_length(parameter_tvb, DATA_1_MTP3_OFFSET, payload_length);
proto_item_set_len(parameter_item, PARAMETER_HEADER_LENGTH);
call_dissector(mtp3_handle, payload_tvb, pinfo, tree);
@@ -520,7 +520,7 @@ dissect_protocol_data_2_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, p
payload_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH - DATA_2_LI_LENGTH;
proto_tree_add_item(parameter_tree, hf_data_2_li, parameter_tvb, DATA_2_LI_OFFSET, DATA_2_LI_LENGTH, ENC_BIG_ENDIAN);
- payload_tvb = tvb_new_subset(parameter_tvb, DATA_2_MTP3_OFFSET, payload_length, payload_length);
+ payload_tvb = tvb_new_subset_length(parameter_tvb, DATA_2_MTP3_OFFSET, payload_length);
proto_item_set_len(parameter_item, PARAMETER_HEADER_LENGTH + DATA_2_LI_LENGTH);
call_dissector(mtp3_handle, payload_tvb, pinfo, tree);
}
@@ -671,7 +671,7 @@ dissect_link_key_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tr
guint16 parameters_length;
parameters_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
- parameters_tvb = tvb_new_subset(parameter_tvb, PARAMETER_VALUE_OFFSET, parameters_length, parameters_length);
+ parameters_tvb = tvb_new_subset_length(parameter_tvb, PARAMETER_VALUE_OFFSET, parameters_length);
dissect_parameters(parameters_tvb, pinfo, tree, parameter_tree);
}
@@ -718,7 +718,7 @@ dissect_registration_result_parameter(tvbuff_t *parameter_tvb, packet_info *pinf
guint16 parameters_length;
parameters_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
- parameters_tvb = tvb_new_subset(parameter_tvb, PARAMETER_VALUE_OFFSET, parameters_length, parameters_length);
+ parameters_tvb = tvb_new_subset_length(parameter_tvb, PARAMETER_VALUE_OFFSET, parameters_length);
dissect_parameters(parameters_tvb, pinfo, tree, parameter_tree);
}
@@ -761,7 +761,7 @@ dissect_deregistration_result_parameter(tvbuff_t *parameter_tvb, packet_info *pi
guint16 parameters_length;
parameters_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
- parameters_tvb = tvb_new_subset(parameter_tvb, PARAMETER_VALUE_OFFSET, parameters_length, parameters_length);
+ parameters_tvb = tvb_new_subset_length(parameter_tvb, PARAMETER_VALUE_OFFSET, parameters_length);
dissect_parameters(parameters_tvb, pinfo, tree, parameter_tree);
}
@@ -1021,7 +1021,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, packet_info *pinfo, proto_tree *tre
if (remaining_length >= length)
total_length = MIN(total_length, remaining_length);
/* create a tvb for the parameter including the padding bytes */
- parameter_tvb = tvb_new_subset(parameters_tvb, offset, total_length, total_length);
+ parameter_tvb = tvb_new_subset_length(parameters_tvb, offset, total_length);
dissect_parameter(parameter_tvb, pinfo, tree, m2ua_tree);
/* get rid of the handled parameter */
offset += total_length;
@@ -1034,7 +1034,7 @@ dissect_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, pro
{
tvbuff_t *common_header_tvb, *parameters_tvb;
- common_header_tvb = tvb_new_subset(message_tvb, 0, COMMON_HEADER_LENGTH, COMMON_HEADER_LENGTH);
+ common_header_tvb = tvb_new_subset_length(message_tvb, 0, COMMON_HEADER_LENGTH);
parameters_tvb = tvb_new_subset_remaining(message_tvb, COMMON_HEADER_LENGTH);
dissect_common_header(common_header_tvb, pinfo, m2ua_tree);
dissect_parameters(parameters_tvb, pinfo, tree, m2ua_tree);
diff --git a/epan/dissectors/packet-m3ua.c b/epan/dissectors/packet-m3ua.c
index da7a7d9017..917d3ba4ef 100644
--- a/epan/dissectors/packet-m3ua.c
+++ b/epan/dissectors/packet-m3ua.c
@@ -394,7 +394,7 @@ dissect_v5_protocol_data_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo,
length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET);
protocol_data_length = length - PARAMETER_HEADER_LENGTH;
- payload_tvb = tvb_new_subset(parameter_tvb, V5_PROTOCOL_DATA_OFFSET, protocol_data_length, protocol_data_length);
+ payload_tvb = tvb_new_subset_length(parameter_tvb, V5_PROTOCOL_DATA_OFFSET, protocol_data_length);
proto_item_append_text(parameter_item, " (SS7 message of %u byte%s)", protocol_data_length, plurality(protocol_data_length, "", "s"));
proto_item_set_len(parameter_item, PARAMETER_HEADER_LENGTH);
call_dissector(mtp3_handle, payload_tvb, pinfo, tree);
@@ -825,7 +825,7 @@ dissect_protocol_data_1_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, p
tvbuff_t *payload_tvb;
protocol_data_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
- payload_tvb = tvb_new_subset(parameter_tvb, PROTOCOL_DATA_1_OFFSET, protocol_data_length, protocol_data_length);
+ payload_tvb = tvb_new_subset_length(parameter_tvb, PROTOCOL_DATA_1_OFFSET, protocol_data_length);
proto_item_append_text(parameter_item, " (SS7 message of %u byte%s)", protocol_data_length, plurality(protocol_data_length, "", "s"));
proto_item_set_len(parameter_item, PARAMETER_HEADER_LENGTH);
call_dissector(mtp3_handle, payload_tvb, pinfo, tree);
@@ -842,7 +842,7 @@ dissect_protocol_data_2_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, p
tvbuff_t *payload_tvb;
protocol_data_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH - LI_OCTETT_LENGTH;
- payload_tvb = tvb_new_subset(parameter_tvb, PROTOCOL_DATA_2_OFFSET, protocol_data_length, protocol_data_length);
+ payload_tvb = tvb_new_subset_length(parameter_tvb, PROTOCOL_DATA_2_OFFSET, protocol_data_length);
proto_tree_add_item(parameter_tree, hf_li, parameter_tvb, LI_OCTETT_OFFSET, LI_OCTETT_LENGTH, ENC_BIG_ENDIAN);
proto_item_append_text(parameter_item, " (SS7 message of %u byte%s)", protocol_data_length, plurality(protocol_data_length, "", "s"));
proto_item_set_len(parameter_item, PARAMETER_HEADER_LENGTH + LI_OCTETT_LENGTH);
@@ -877,7 +877,7 @@ dissect_routing_key_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto
length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET);
parameters_length = length - PARAMETER_HEADER_LENGTH;
- parameters_tvb = tvb_new_subset(parameter_tvb, PARAMETER_VALUE_OFFSET, parameters_length, parameters_length);
+ parameters_tvb = tvb_new_subset_length(parameter_tvb, PARAMETER_VALUE_OFFSET, parameters_length);
dissect_parameters(parameters_tvb, pinfo, tree, parameter_tree);
}
@@ -917,7 +917,7 @@ dissect_registration_result_parameter(tvbuff_t *parameter_tvb, packet_info *pinf
length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET);
parameters_length = length - PARAMETER_HEADER_LENGTH;
- parameters_tvb = tvb_new_subset(parameter_tvb, PARAMETER_VALUE_OFFSET, parameters_length, parameters_length);
+ parameters_tvb = tvb_new_subset_length(parameter_tvb, PARAMETER_VALUE_OFFSET, parameters_length);
dissect_parameters(parameters_tvb, pinfo, tree, parameter_tree);
}
@@ -950,7 +950,7 @@ dissect_deregistration_result_parameter(tvbuff_t *parameter_tvb, packet_info *pi
length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET);
parameters_length = length - PARAMETER_HEADER_LENGTH;
- parameters_tvb = tvb_new_subset(parameter_tvb, PARAMETER_VALUE_OFFSET, parameters_length, parameters_length);
+ parameters_tvb = tvb_new_subset_length(parameter_tvb, PARAMETER_VALUE_OFFSET, parameters_length);
dissect_parameters(parameters_tvb, pinfo, tree, parameter_tree);
}
@@ -1169,7 +1169,7 @@ dissect_protocol_data_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, pro
si = tvb_get_guint8(parameter_tvb, DATA_SI_OFFSET);
ulp_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH - DATA_HDR_LENGTH;
- payload_tvb = tvb_new_subset(parameter_tvb, DATA_ULP_OFFSET, ulp_length, ulp_length);
+ payload_tvb = tvb_new_subset_length(parameter_tvb, DATA_ULP_OFFSET, ulp_length);
dpc = tvb_get_ntohl(parameter_tvb, DATA_DPC_OFFSET);
opc = tvb_get_ntohl(parameter_tvb, DATA_OPC_OFFSET);
@@ -1255,7 +1255,7 @@ dissect_protocol_data_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, pro
}/* parameter_tree */
- payload_tvb = tvb_new_subset(parameter_tvb, DATA_ULP_OFFSET, ulp_length, ulp_length);
+ payload_tvb = tvb_new_subset_length(parameter_tvb, DATA_ULP_OFFSET, ulp_length);
if (!dissector_try_uint(si_dissector_table, tvb_get_guint8(parameter_tvb, DATA_SI_OFFSET), payload_tvb, pinfo, tree))
call_dissector(data_handle, payload_tvb, pinfo, tree);
@@ -1324,7 +1324,7 @@ dissect_registration_results_parameter(tvbuff_t *parameter_tvb, packet_info *pin
guint16 parameters_length;
parameters_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
- parameters_tvb = tvb_new_subset(parameter_tvb, PARAMETER_VALUE_OFFSET, parameters_length, parameters_length);
+ parameters_tvb = tvb_new_subset_length(parameter_tvb, PARAMETER_VALUE_OFFSET, parameters_length);
dissect_parameters(parameters_tvb, pinfo, tree, parameter_tree);
}
@@ -1335,7 +1335,7 @@ dissect_deregistration_results_parameter(tvbuff_t *parameter_tvb, packet_info *p
guint16 parameters_length;
parameters_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
- parameters_tvb = tvb_new_subset(parameter_tvb, PARAMETER_VALUE_OFFSET, parameters_length, parameters_length);
+ parameters_tvb = tvb_new_subset_length(parameter_tvb, PARAMETER_VALUE_OFFSET, parameters_length);
dissect_parameters(parameters_tvb, pinfo, tree, parameter_tree);
}
@@ -1962,7 +1962,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, packet_info *pinfo, proto_tree *tre
if (remaining_length >= length)
total_length = MIN(total_length, remaining_length);
/* create a tvb for the parameter including the padding bytes */
- parameter_tvb = tvb_new_subset(parameters_tvb, offset, total_length, total_length);
+ parameter_tvb = tvb_new_subset_length(parameters_tvb, offset, total_length);
switch(version) {
case M3UA_V5:
dissect_v5_parameter(parameter_tvb, pinfo, tree, m3ua_tree);
@@ -1988,7 +1988,7 @@ dissect_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, pro
{
tvbuff_t *common_header_tvb, *parameters_tvb;
- common_header_tvb = tvb_new_subset(message_tvb, 0, COMMON_HEADER_LENGTH, COMMON_HEADER_LENGTH);
+ common_header_tvb = tvb_new_subset_length(message_tvb, 0, COMMON_HEADER_LENGTH);
parameters_tvb = tvb_new_subset_remaining(message_tvb, COMMON_HEADER_LENGTH);
if (version == M3UA_V5)
dissect_v5_common_header(common_header_tvb, pinfo, m3ua_tree);
diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c
index ed3756c40e..f4f0533953 100644
--- a/epan/dissectors/packet-mac-lte.c
+++ b/epan/dissectors/packet-mac-lte.c
@@ -2849,7 +2849,7 @@ static void call_rlc_dissector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
guint8 UMSequenceNumberLength,
guint8 priority)
{
- tvbuff_t *rb_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ tvbuff_t *rb_tvb = tvb_new_subset_length(tvb, offset, data_length);
struct rlc_lte_info *p_rlc_lte_info;
/* Resuse or create RLC info */
@@ -4025,7 +4025,7 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
proto_tree_add_item(cr_tree, hf_mac_lte_control_ue_contention_resolution_identity,
tvb, offset, 6, ENC_NA);
if (global_mac_lte_decode_cr_body) {
- tvbuff_t *cr_body_tvb = tvb_new_subset(tvb, offset, 6, 6);
+ tvbuff_t *cr_body_tvb = tvb_new_subset_length(tvb, offset, 6);
dissector_handle_t ul_ccch_handle = find_dissector("lte_rrc.ul_ccch");
if (ul_ccch_handle != 0) {
call_with_catch_all(ul_ccch_handle, cr_body_tvb, pinfo, cr_tree);
@@ -4646,7 +4646,7 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* CCCH frames can be dissected directly by LTE RRC... */
if ((lcids[n] == 0) && global_mac_lte_attempt_rrc_decode) {
- tvbuff_t *rrc_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ tvbuff_t *rrc_tvb = tvb_new_subset_length(tvb, offset, data_length);
/* Get appropriate dissector handle */
volatile dissector_handle_t protocol_handle = 0;
diff --git a/epan/dissectors/packet-macsec.c b/epan/dissectors/packet-macsec.c
index e19f454871..b759cd8d4a 100644
--- a/epan/dissectors/packet-macsec.c
+++ b/epan/dissectors/packet-macsec.c
@@ -93,7 +93,7 @@ static int dissect_macsec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
data_length = tvb_length(tvb) - sectag_length - icv_length;
icv_offset = data_length + data_offset;
- next_tvb = tvb_new_subset(tvb, data_offset, data_length, data_length);
+ next_tvb = tvb_new_subset_length(tvb, data_offset, data_length);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MACSEC");
col_set_str(pinfo->cinfo, COL_INFO, "MACsec frame");
diff --git a/epan/dissectors/packet-mbim.c b/epan/dissectors/packet-mbim.c
index 18a4dda3c3..b33d2fa38a 100644
--- a/epan/dissectors/packet-mbim.c
+++ b/epan/dissectors/packet-mbim.c
@@ -2989,8 +2989,8 @@ mbim_dissect_sms_pdu_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if (pdu_data_size > (guint32)(sc_address_size + 1)) {
pdu_data_size -= sc_address_size + 1;
- sms_tvb = tvb_new_subset(tvb, base_offset + pdu_data_offset + 1 + sc_address_size,
- pdu_data_size, pdu_data_size);
+ sms_tvb = tvb_new_subset_length(tvb, base_offset + pdu_data_offset + 1 + sc_address_size,
+ pdu_data_size);
pinfo->p2p_dir = (message_status < 2) ? P2P_DIR_SENT : P2P_DIR_RECV;
call_dissector(gsm_sms_handle, sms_tvb, pinfo, subtree);
}
@@ -2999,7 +2999,7 @@ mbim_dissect_sms_pdu_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
pdu_data_size, ENC_NA);
subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
if ((mbim_conv->cellular_class & MBIM_CELLULAR_CLASS_CDMA) && cdma_sms_handle) {
- sms_tvb = tvb_new_subset(tvb, base_offset + pdu_data_offset, pdu_data_size, pdu_data_size);
+ sms_tvb = tvb_new_subset_length(tvb, base_offset + pdu_data_offset, pdu_data_size);
call_dissector(cdma_sms_handle, sms_tvb, pinfo, subtree);
}
}
@@ -3188,8 +3188,8 @@ mbim_dissect_sms_send_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
sc_address_size, NULL, 0);
}
if (pdu_data_size > (guint32)(sc_address_size + 1)) {
- sms_tvb = tvb_new_subset(tvb, base_offset + pdu_data_offset + 1 + sc_address_size,
- pdu_data_size, pdu_data_size);
+ sms_tvb = tvb_new_subset_length(tvb, base_offset + pdu_data_offset + 1 + sc_address_size,
+ pdu_data_size);
pinfo->p2p_dir = P2P_DIR_RECV;
call_dissector(gsm_sms_handle, sms_tvb, pinfo, subtree);
}
@@ -3198,7 +3198,7 @@ mbim_dissect_sms_send_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
pdu_data_size, ENC_NA);
subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
if ((mbim_conv->cellular_class & MBIM_CELLULAR_CLASS_CDMA) && cdma_sms_handle) {
- sms_tvb = tvb_new_subset(tvb, base_offset + pdu_data_offset, pdu_data_size, pdu_data_size);
+ sms_tvb = tvb_new_subset_length(tvb, base_offset + pdu_data_offset, pdu_data_size);
call_dissector(cdma_sms_handle, sms_tvb, pinfo, subtree);
}
}
@@ -3294,7 +3294,7 @@ mbim_dissect_set_ussd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint
ti = proto_tree_add_item(tree, hf_mbim_set_ussd_ussd_payload, tvb, base_offset + ussd_payload_offset,
ussd_payload_length, ENC_NA);
subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
- ussd_tvb = tvb_new_subset(tvb, base_offset + ussd_payload_offset, ussd_payload_length, ussd_payload_length);
+ ussd_tvb = tvb_new_subset_length(tvb, base_offset + ussd_payload_offset, ussd_payload_length);
switch (encoding) {
case SMS_ENCODING_7BIT:
case SMS_ENCODING_7BIT_LANG:
@@ -3346,7 +3346,7 @@ mbim_dissect_ussd_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint
ti = proto_tree_add_item(tree, hf_mbim_ussd_info_ussd_payload, tvb, base_offset + ussd_payload_offset,
ussd_payload_length, ENC_NA);
subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
- ussd_tvb = tvb_new_subset(tvb, base_offset + ussd_payload_offset, ussd_payload_length, ussd_payload_length);
+ ussd_tvb = tvb_new_subset_length(tvb, base_offset + ussd_payload_offset, ussd_payload_length);
switch (encoding) {
case SMS_ENCODING_7BIT:
case SMS_ENCODING_7BIT_LANG:
@@ -3608,7 +3608,7 @@ mbim_dissect_set_stk_terminal_response(tvbuff_t *tvb, packet_info *pinfo, proto_
ti = proto_tree_add_item(tree, hf_mbim_set_stk_terminal_response_data_buffer, tvb, offset, response_length, ENC_NA);
if (etsi_cat_handle) {
subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
- pac_tvb = tvb_new_subset(tvb, offset, response_length, response_length);
+ pac_tvb = tvb_new_subset_length(tvb, offset, response_length);
call_dissector(etsi_cat_handle, pac_tvb, pinfo, subtree);
}
}
@@ -4206,7 +4206,7 @@ dissect_mbim_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
frag_tvb, offset, info_buff_len, ENC_NA);
if (bertlv_handle) {
env_tree = proto_item_add_subtree(ti, ett_mbim_buffer);
- env_tvb = tvb_new_subset(frag_tvb, offset, info_buff_len, info_buff_len);
+ env_tvb = tvb_new_subset_length(frag_tvb, offset, info_buff_len);
call_dissector(bertlv_handle, env_tvb, pinfo, env_tree);
}
} else if (info_buff_len) {
@@ -4666,7 +4666,7 @@ dissect_mbim_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
ti = proto_tree_add_item(subtree, hf_mbim_stk_pac_pac, frag_tvb, offset, pac_length, ENC_NA);
if (bertlv_handle) {
pac_tree = proto_item_add_subtree(ti, ett_mbim_buffer);
- pac_tvb = tvb_new_subset(frag_tvb, offset, pac_length, pac_length);
+ pac_tvb = tvb_new_subset_length(frag_tvb, offset, pac_length);
call_dissector(bertlv_handle, pac_tvb, pinfo, pac_tree);
}
}
diff --git a/epan/dissectors/packet-mbtcp.c b/epan/dissectors/packet-mbtcp.c
index 8535921255..75687b560e 100644
--- a/epan/dissectors/packet-mbtcp.c
+++ b/epan/dissectors/packet-mbtcp.c
@@ -480,7 +480,7 @@ dissect_mbtcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
proto_tree_add_uint(mbtcp_tree, hf_mbtcp_unitid, tvb, offset + 6, 1, unit_id);
/* dissect the Modbus PDU */
- next_tvb = tvb_new_subset( tvb, offset+7, len-1, len-1);
+ next_tvb = tvb_new_subset_length( tvb, offset+7, len-1);
/* keep existing context */
p_save_proto_data = p_get_proto_data(wmem_file_scope(), pinfo, proto_modbus, 0 );
@@ -622,7 +622,7 @@ dissect_mbrtu_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
len = len - 2;
/* dissect the Modbus PDU */
- next_tvb = tvb_new_subset( tvb, offset+1, len-1, len-1);
+ next_tvb = tvb_new_subset_length( tvb, offset+1, len-1);
/* keep existing context */
p_save_proto_data = p_get_proto_data(wmem_file_scope(), pinfo, proto_modbus, 0 );
diff --git a/epan/dissectors/packet-mdshdr.c b/epan/dissectors/packet-mdshdr.c
index ee787e46d1..7c57f915cc 100644
--- a/epan/dissectors/packet-mdshdr.c
+++ b/epan/dissectors/packet-mdshdr.c
@@ -232,7 +232,7 @@ dissect_mdshdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_length(tvb) >= MDSHDR_HEADER_SIZE + pktlen
&& 0 != pktlen /*if something wrong*/) {
- next_tvb = tvb_new_subset(tvb, MDSHDR_HEADER_SIZE, pktlen, pktlen);
+ next_tvb = tvb_new_subset_length(tvb, MDSHDR_HEADER_SIZE, pktlen);
/* XXX what to do with the rest of this frame? --ArtemTamazov */
}
else {
diff --git a/epan/dissectors/packet-megaco.c b/epan/dissectors/packet-megaco.c
index 1036f3a673..34ffbe0f50 100644
--- a/epan/dissectors/packet-megaco.c
+++ b/epan/dissectors/packet-megaco.c
@@ -2967,7 +2967,7 @@ dissect_megaco_Localdescriptor(tvbuff_t *tvb, proto_tree *megaco_mediadescriptor
tokenlen = tvb_next_offset - tvb_current_offset;
if ( tokenlen > 3 ){
- next_tvb = tvb_new_subset(tvb, tvb_current_offset, tokenlen, tokenlen);
+ next_tvb = tvb_new_subset_length(tvb, tvb_current_offset, tokenlen);
call_dissector(sdp_handle, next_tvb, pinfo, megaco_localdescriptor_tree);
}
}
diff --git a/epan/dissectors/packet-mih.c b/epan/dissectors/packet-mih.c
index 4c4d408318..2cabd662dc 100644
--- a/epan/dissectors/packet-mih.c
+++ b/epan/dissectors/packet-mih.c
@@ -1630,7 +1630,7 @@ static void dissect_mih_tlv(tvbuff_t *tvb,int offset, proto_tree *tlv_tree, guin
tvb_mihf_id = tvb_new_composite();
for(i=0; i < mihf_id_len/2; i++)
{
- tvb_temp = tvb_new_subset(tvb, offset + 2 + 2*i, 1 , 1);
+ tvb_temp = tvb_new_subset_length(tvb, offset + 2 + 2*i, 1);
tvb_composite_append(tvb_mihf_id, tvb_temp);
}
TRY
diff --git a/epan/dissectors/packet-mikey.c b/epan/dissectors/packet-mikey.c
index 4ee22b92b0..c946854f22 100644
--- a/epan/dissectors/packet-mikey.c
+++ b/epan/dissectors/packet-mikey.c
@@ -768,7 +768,7 @@ dissect_payload_kemac(mikey_t *mikey, tvbuff_t *tvb, packet_info *pinfo, proto_t
key_data_item = proto_tree_add_item(tree, hf_mikey_pl[PL_KEY_DATA], tvb, 4, encr_length, ENC_NA);
key_data_tree = proto_item_add_subtree(key_data_item, ett_mikey_enc_data);
- sub_tvb = tvb_new_subset(tvb, offset+4, encr_length, encr_length);
+ sub_tvb = tvb_new_subset_length(tvb, offset+4, encr_length);
dissect_payload(PL_KEY_DATA, mikey, sub_tvb, pinfo, key_data_tree);
} else {
/* If Key Data is encrypted, show only the encr_data */
@@ -1000,7 +1000,7 @@ dissect_payload_cert(mikey_t *mikey _U_, tvbuff_t *tvb, packet_info *pinfo, prot
proto_item_append_text(parent, " Type: %s", val_to_str_const(type, cert_type_vals, "Unknown"));
}
- subtvb = tvb_new_subset(tvb, offset+4, length, length);
+ subtvb = tvb_new_subset_length(tvb, offset+4, length);
dissect_x509af_Certificate(FALSE, subtvb, 0, &asn1_ctx, tree, hf_mikey[POS_CERTIFICATE]);
return 4 + length;
@@ -1118,7 +1118,7 @@ dissect_payload_sp(mikey_t *mikey _U_, tvbuff_t *tvb, packet_info *pinfo _U_, pr
int param_len;
tvbuff_t *subtvb;
- subtvb = tvb_new_subset(tvb, offset+sub_pos, length-sub_pos, length-sub_pos);
+ subtvb = tvb_new_subset_length(tvb, offset+sub_pos, length-sub_pos);
param_len = dissect_payload_sp_param(type, subtvb, tree);
if (param_len < 0)
diff --git a/epan/dissectors/packet-mint.c b/epan/dissectors/packet-mint.c
index fb97a0f1e2..469d3fddd6 100644
--- a/epan/dissectors/packet-mint.c
+++ b/epan/dissectors/packet-mint.c
@@ -291,7 +291,7 @@ dissect_eth_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mint_tree,
col_set_writable(pinfo->cinfo, FALSE);
#endif
- eth_tvb = tvb_new_subset(tvb, offset, length, length);
+ eth_tvb = tvb_new_subset_length(tvb, offset, length);
/* Continue after Ethernet dissection errors */
TRY {
call_dissector(eth_handle, eth_tvb, pinfo, mint_tree);
diff --git a/epan/dissectors/packet-mip.c b/epan/dissectors/packet-mip.c
index af9b4ae4a1..8939a25f0c 100644
--- a/epan/dissectors/packet-mip.c
+++ b/epan/dissectors/packet-mip.c
@@ -748,7 +748,7 @@ dissect_mip_extensions( tvbuff_t *tvb, int offset, proto_tree *tree, packet_info
proto_tree_add_item(ext_tree, hf_mip_nvse_vendor_org_id, tvb, nvse_local_offset, 4, ENC_BIG_ENDIAN);
nvse_local_offset+=4;
- next_tvb = tvb_new_subset(tvb, nvse_local_offset, ext_len-6, ext_len-6);
+ next_tvb = tvb_new_subset_length(tvb, nvse_local_offset, ext_len-6);
if (!dissector_try_uint(mip_nvse_ext_dissector_table, nvse_vendor_org_id, next_tvb, pinfo, ext_tree)){
/*Vendor NVSE Type*/
diff --git a/epan/dissectors/packet-mip6.c b/epan/dissectors/packet-mip6.c
index b11ee0024e..78e3b283d1 100644
--- a/epan/dissectors/packet-mip6.c
+++ b/epan/dissectors/packet-mip6.c
@@ -1798,7 +1798,7 @@ dissect_mip6_opt_vsm_3gpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
* FQ-CSID as specified in subclause 12.1.1.2
*/
case 5:
- next_tvb = tvb_new_subset(tvb, offset, len, len);
+ next_tvb = tvb_new_subset_length(tvb, offset, len);
dissect_gtpv2_fq_csid(next_tvb, pinfo, tree, hdr_item, len, 0, 0);
break;
/* 6, PMIPv6 PDN type indication */
@@ -1816,7 +1816,7 @@ dissect_mip6_opt_vsm_3gpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
break;
/* 8, Selection Mode */
case 8:
- next_tvb = tvb_new_subset(tvb, offset, len, len);
+ next_tvb = tvb_new_subset_length(tvb, offset, len);
dissect_gtpv2_selec_mode(next_tvb, pinfo, tree, hdr_item, len, 0, 0);
break;
/* 9, I-WLAN Mobility Access Point Name (APN) */
@@ -1862,7 +1862,7 @@ dissect_mip6_opt_vsm_3gpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
break;
/* 18, PGW Back-Off Time */
case 18:
- next_tvb = tvb_new_subset(tvb, offset, len, len);
+ next_tvb = tvb_new_subset_length(tvb, offset, len);
dissect_gtpv2_epc_timer(next_tvb, pinfo, tree, hdr_item, len, 0, 0);
break;
/* 19, Signalling Priority Indication */
@@ -2236,7 +2236,7 @@ dissect_mip6_opt_vsm(const mip6_opt *optp _U_, tvbuff_t *tvb, int offset,
proto_item_append_text(hdr_item, ": %s", val_to_str_ext_const(vendorid, &sminmpec_values_ext, "<unknown>"));
offset += 4;
- next_tvb = tvb_new_subset(tvb, offset, optlen-MIP6_VSM_SUBTYPE_OFF, optlen-MIP6_VSM_SUBTYPE_OFF);
+ next_tvb = tvb_new_subset_length(tvb, offset, optlen-MIP6_VSM_SUBTYPE_OFF);
if (!dissector_try_uint(mip6_vsm_dissector_table, vendorid, next_tvb, pinfo, opt_tree)){
proto_tree_add_item(opt_tree, hf_mip6_vsm_subtype, tvb,
offset, MIP6_VSM_SUBTYPE_LEN, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-mp2t.c b/epan/dissectors/packet-mp2t.c
index 8ddf8b6804..0812737591 100644
--- a/epan/dissectors/packet-mp2t.c
+++ b/epan/dissectors/packet-mp2t.c
@@ -745,7 +745,7 @@ mp2t_process_fragmented_payload(tvbuff_t *tvb, gint offset, guint remaining_len,
/* Check for full packets within this TS frame */
if (frag_tot_len &&
frag_tot_len <= remaining_len) {
- next_tvb = tvb_new_subset(tvb, offset, frag_tot_len, frag_tot_len);
+ next_tvb = tvb_new_subset_length(tvb, offset, frag_tot_len);
mp2t_dissect_packet(next_tvb, pid_analysis->pload_type, pinfo, tree);
remaining_len -= frag_tot_len;
offset += frag_tot_len;
diff --git a/epan/dissectors/packet-mpeg-dsmcc.c b/epan/dissectors/packet-mpeg-dsmcc.c
index 4fc7239ebc..b4b64ecaf0 100644
--- a/epan/dissectors/packet-mpeg-dsmcc.c
+++ b/epan/dissectors/packet-mpeg-dsmcc.c
@@ -283,7 +283,7 @@ dissect_dsmcc_adaptation_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
proto_tree_add_item(sub_tree, hf_dsmcc_adaptation_ca_length, tvb,
offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- sub_tvb = tvb_new_subset(tvb, offset, ca_len, ca_len);
+ sub_tvb = tvb_new_subset_length(tvb, offset, ca_len);
call_dissector(data_handle, sub_tvb, pinfo, tree);
} else if (2 == type) {
pi = proto_tree_add_text(tree, tvb, offset, -1, "Adaptation Header");
@@ -368,7 +368,7 @@ dissect_dsmcc_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint
offset += 2;
if (0 < adaptation_len) {
- sub_tvb = tvb_new_subset(tvb, offset, adaptation_len, adaptation_len);
+ sub_tvb = tvb_new_subset_length(tvb, offset, adaptation_len);
dissect_dsmcc_adaptation_header(sub_tvb, pinfo, sub_tree);
offset += adaptation_len;
}
@@ -769,7 +769,7 @@ dissect_dsmcc_ts(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree_in, void *d
offset, 1, ENC_BIG_ENDIAN);
offset +=1;
- sub_tvb = tvb_new_subset(tvb, offset, sect_len-9, sect_len-9);
+ sub_tvb = tvb_new_subset_length(tvb, offset, sect_len-9);
switch (tid) {
case DSMCC_TID_LLCSNAP:
/* TODO: Add support */
diff --git a/epan/dissectors/packet-mpeg-pes.c b/epan/dissectors/packet-mpeg-pes.c
index 2b03160086..81b181b6d9 100644
--- a/epan/dissectors/packet-mpeg-pes.c
+++ b/epan/dissectors/packet-mpeg-pes.c
@@ -940,8 +940,8 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
header_length = tvb_get_guint8(tvb, 8);
if (header_length > 0) {
int flags = tvb_get_guint8(tvb, 7);
- tvbuff_t *header_data = tvb_new_subset(tvb, offset / 8,
- header_length, header_length);
+ tvbuff_t *header_data = tvb_new_subset_length(tvb, offset / 8,
+ header_length);
dissect_mpeg_pes_header_data(header_data, pinfo, tree, flags);
offset += header_length * 8;
/* length may be zero for Video stream */
diff --git a/epan/dissectors/packet-mstp.c b/epan/dissectors/packet-mstp.c
index 13f0a545cc..b309e15a77 100644
--- a/epan/dissectors/packet-mstp.c
+++ b/epan/dissectors/packet-mstp.c
@@ -245,8 +245,8 @@ dissect_mstp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
mstp_tvb_pdu_len -= 2;
if (mstp_frame_type < 128) {
vendorid = 0;
- next_tvb = tvb_new_subset(tvb, offset,
- mstp_tvb_pdu_len, mstp_frame_pdu_len);
+ next_tvb = tvb_new_subset_length(tvb, offset,
+ mstp_tvb_pdu_len);
} else {
/* With Vendor ID */
vendorid = tvb_get_ntohs(tvb, offset);
diff --git a/epan/dissectors/packet-mtp2.c b/epan/dissectors/packet-mtp2.c
index f440474b82..87b99ba580 100644
--- a/epan/dissectors/packet-mtp2.c
+++ b/epan/dissectors/packet-mtp2.c
@@ -283,10 +283,10 @@ dissect_mtp2_msu(tvbuff_t *su_tvb, packet_info *pinfo, proto_item *mtp2_item, pr
if (use_extended_sequence_numbers) {
sif_sio_length = tvb_length(su_tvb) - EXTENDED_HEADER_LENGTH;
- sif_sio_tvb = tvb_new_subset(su_tvb, EXTENDED_SIO_OFFSET, sif_sio_length, sif_sio_length);
+ sif_sio_tvb = tvb_new_subset_length(su_tvb, EXTENDED_SIO_OFFSET, sif_sio_length);
} else {
sif_sio_length = tvb_length(su_tvb) - HEADER_LENGTH;
- sif_sio_tvb = tvb_new_subset(su_tvb, SIO_OFFSET, sif_sio_length, sif_sio_length);
+ sif_sio_tvb = tvb_new_subset_length(su_tvb, SIO_OFFSET, sif_sio_length);
}
call_dissector(mtp3_handle, sif_sio_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-mtp3.c b/epan/dissectors/packet-mtp3.c
index b04c93728d..97c5757e9a 100644
--- a/epan/dissectors/packet-mtp3.c
+++ b/epan/dissectors/packet-mtp3.c
@@ -658,27 +658,24 @@ dissect_mtp3_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
static guint
heur_mtp3_standard(tvbuff_t *tvb, packet_info *pinfo, guint8 si)
{
-
- guint32 len;
tvbuff_t *payload;
- len = tvb_length(tvb);
switch (si) {
case MTP_SI_SCCP:
{
- payload = tvb_new_subset(tvb, ITU_HEADER_LENGTH, len-ITU_HEADER_LENGTH, len-ITU_HEADER_LENGTH);
+ payload = tvb_new_subset_remaining(tvb, ITU_HEADER_LENGTH);
if (looks_like_valid_sccp(PINFO_FD_NUM(pinfo), payload, ITU_STANDARD)) {
return ITU_STANDARD;
}
- payload = tvb_new_subset(tvb, ANSI_HEADER_LENGTH, len-ANSI_HEADER_LENGTH, len-ANSI_HEADER_LENGTH);
+ payload = tvb_new_subset_remaining(tvb, ANSI_HEADER_LENGTH);
if (looks_like_valid_sccp(PINFO_FD_NUM(pinfo), payload, ANSI_STANDARD)) {
return ANSI_STANDARD;
}
- payload = tvb_new_subset(tvb, ANSI_HEADER_LENGTH, len-ANSI_HEADER_LENGTH, len-ANSI_HEADER_LENGTH);
+ payload = tvb_new_subset_remaining(tvb, ANSI_HEADER_LENGTH);
if (looks_like_valid_sccp(PINFO_FD_NUM(pinfo), payload, CHINESE_ITU_STANDARD)) {
return CHINESE_ITU_STANDARD;
}
- payload = tvb_new_subset(tvb, JAPAN_HEADER_LENGTH, len-JAPAN_HEADER_LENGTH, len-JAPAN_HEADER_LENGTH);
+ payload = tvb_new_subset_remaining(tvb, JAPAN_HEADER_LENGTH);
if (looks_like_valid_sccp(PINFO_FD_NUM(pinfo), payload, JAPAN_STANDARD)) {
return JAPAN_STANDARD;
}
diff --git a/epan/dissectors/packet-multipart.c b/epan/dissectors/packet-multipart.c
index 35a279d464..c1dae370a0 100644
--- a/epan/dissectors/packet-multipart.c
+++ b/epan/dissectors/packet-multipart.c
@@ -698,8 +698,7 @@ process_body_part(proto_tree *tree, tvbuff_t *tvb, const guint8 *boundary,
&boundary_line_len, last_boundary);
if (boundary_start > 0) {
gint body_len = boundary_start - body_start;
- tvbuff_t *tmp_tvb = tvb_new_subset(tvb, body_start,
- body_len, body_len);
+ tvbuff_t *tmp_tvb = tvb_new_subset_length(tvb, body_start, body_len);
if (content_type_str) {
diff --git a/epan/dissectors/packet-nas_eps.c b/epan/dissectors/packet-nas_eps.c
index 55c9ebee40..8ad5e7fbf4 100644
--- a/epan/dissectors/packet-nas_eps.c
+++ b/epan/dissectors/packet-nas_eps.c
@@ -427,7 +427,7 @@ de_eps_cmn_add_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
item = proto_tree_add_item(tree, hf_nas_eps_cmn_add_info, tvb, offset, len, ENC_NA);
sub_tree = proto_item_add_subtree(item, ett_nas_eps_cmn_add_info);
- new_tvb = tvb_new_subset(tvb, offset, len, len);
+ new_tvb = tvb_new_subset_length(tvb, offset, len);
switch (eps_nas_gen_msg_cont_type) {
case 1:
@@ -1081,13 +1081,13 @@ de_emm_eps_mid(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
switch (octet&0x7) {
case 1:
/* IMSI */
- new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
+ new_tvb = tvb_new_subset_length(tvb, curr_offset, len);
digit_str = unpack_eps_mid_digits(new_tvb);
proto_tree_add_string(tree, hf_nas_eps_emm_imsi, new_tvb, 0, -1, digit_str);
break;
case 3:
/* IMEI */
- new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
+ new_tvb = tvb_new_subset_length(tvb, curr_offset, len);
digit_str = unpack_eps_mid_digits(new_tvb);
proto_tree_add_string(tree, hf_nas_eps_emm_imei, new_tvb, 0, -1, digit_str);
break;
@@ -1219,7 +1219,7 @@ de_emm_esm_msg_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
sub_tree = proto_item_add_subtree(item, ett_nas_eps_esm_msg_cont);
/* This IE can contain any ESM PDU as defined in subclause 8.3. */
- new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
+ new_tvb = tvb_new_subset_length(tvb, curr_offset, len);
/* Plain NAS message */
disect_nas_eps_esm_msg(new_tvb, pinfo, sub_tree, 0/* offset */);
@@ -1409,7 +1409,7 @@ de_emm_nas_msg_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
item = proto_tree_add_item(tree, hf_nas_eps_nas_msg_cont, tvb, curr_offset, len, ENC_NA);
sub_tree = proto_item_add_subtree(item, ett_nas_eps_nas_msg_cont);
- new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
+ new_tvb = tvb_new_subset_length(tvb, curr_offset, len);
if (gsm_a_dtap_handle)
call_dissector(gsm_a_dtap_handle, new_tvb, pinfo, sub_tree);
@@ -2071,7 +2071,7 @@ de_emm_lcs_client_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
* The coding of the value part of the LCS client identity is given
* in subclause 17.7.13 of 3GPP TS 29.002 [15B](GSM MAP).
*/
- new_tvb = tvb_new_subset(tvb, curr_offset, len, len );
+ new_tvb = tvb_new_subset_length(tvb, curr_offset, len);
dissect_gsm_map_lcs_LCS_ClientID_PDU( new_tvb, pinfo, tree, NULL );
return(len);
@@ -2119,7 +2119,7 @@ de_emm_gen_msg_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
item = proto_tree_add_item(tree, hf_nas_eps_gen_msg_cont, tvb, offset, len, ENC_NA);
sub_tree = proto_item_add_subtree(item, ett_nas_eps_gen_msg_cont);
- new_tvb = tvb_new_subset(tvb, offset, len, len);
+ new_tvb = tvb_new_subset_length(tvb, offset, len);
switch (eps_nas_gen_msg_cont_type) {
case 1:
diff --git a/epan/dissectors/packet-nasdaq-soup.c b/epan/dissectors/packet-nasdaq-soup.c
index 4dc3f4e6d0..4e0ba4de12 100644
--- a/epan/dissectors/packet-nasdaq-soup.c
+++ b/epan/dissectors/packet-nasdaq-soup.c
@@ -108,7 +108,7 @@ dissect_nasdaq_soup_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent
case 'U': /* unsequenced data packed */
case 'S': /* sequenced data packed */
if (linelen > 1 && nasdaq_itch_handle) {
- new_tvb = tvb_new_subset(tvb, offset,linelen -1,linelen -1);
+ new_tvb = tvb_new_subset_length(tvb, offset,linelen -1);
} else {
proto_tree_add_item(tree, hf_nasdaq_soup_message, tvb, offset, linelen -1, ENC_ASCII|ENC_NA);
}
diff --git a/epan/dissectors/packet-nflog.c b/epan/dissectors/packet-nflog.c
index 62e4ac4a77..3d786a195e 100644
--- a/epan/dissectors/packet-nflog.c
+++ b/epan/dissectors/packet-nflog.c
@@ -235,7 +235,7 @@ dissect_nflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tlv_type == WS_NFULA_PAYLOAD)
- next_tvb = tvb_new_subset(tvb, offset + 4, value_len, value_len);
+ next_tvb = tvb_new_subset_length(tvb, offset + 4, value_len);
offset += ((tlv_len + 3) & ~3); /* next TLV aligned to 4B */
}
diff --git a/epan/dissectors/packet-nwmtp.c b/epan/dissectors/packet-nwmtp.c
index 0a0fb0f99a..6a937e3f34 100644
--- a/epan/dissectors/packet-nwmtp.c
+++ b/epan/dissectors/packet-nwmtp.c
@@ -105,7 +105,7 @@ static void dissect_nwmtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb, offset + 8, 4, ENC_BIG_ENDIAN);
}
- next_tvb = tvb_new_subset(tvb, offset + 12, len, len);
+ next_tvb = tvb_new_subset_length(tvb, offset + 12, len);
if (tvb_length(next_tvb) > 0)
call_dissector(mtp_handle, next_tvb, pinfo, tree);
/* Check for overflows, which probably can't happen, but better
diff --git a/epan/dissectors/packet-openflow_v1.c b/epan/dissectors/packet-openflow_v1.c
index 5836af9169..56b7f49f79 100644
--- a/epan/dissectors/packet-openflow_v1.c
+++ b/epan/dissectors/packet-openflow_v1.c
@@ -606,7 +606,7 @@ dissect_openflow_pkt_in(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
offset+=1;
/*proto_tree_add_text(tree, tvb, offset, length-offset, "Offset=%u, remaining %u", offset, length-offset);*/
- next_tvb = tvb_new_subset(tvb, offset, length-offset, length-offset);
+ next_tvb = tvb_new_subset_length(tvb, offset, length-offset);
call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
}
@@ -638,7 +638,7 @@ dissect_openflow_pkt_out(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
*/
if(buffer_id == -1){
/* proto_tree_add_text(tree, tvb, offset, -1, "Packet data"); */
- next_tvb = tvb_new_subset(tvb, offset, length-offset, length-offset);
+ next_tvb = tvb_new_subset_length(tvb, offset, length-offset);
call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
}
}
diff --git a/epan/dissectors/packet-openflow_v4.c b/epan/dissectors/packet-openflow_v4.c
index 901cc00223..71220c9d7d 100644
--- a/epan/dissectors/packet-openflow_v4.c
+++ b/epan/dissectors/packet-openflow_v4.c
@@ -1836,7 +1836,7 @@ dissect_openflow_packet_in_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
/* dissect data */
col_set_writable(pinfo->cinfo, FALSE);
- next_tvb = tvb_new_subset(tvb, offset, length - offset, length - offset);
+ next_tvb = tvb_new_subset_length(tvb, offset, length - offset);
call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, data_tree);
/* restore saved state */
@@ -2427,7 +2427,7 @@ dissect_openflow_packet_out_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
/* dissect data */
col_set_writable(pinfo->cinfo, FALSE);
- next_tvb = tvb_new_subset(tvb, offset, length - offset, length - offset);
+ next_tvb = tvb_new_subset_length(tvb, offset, length - offset);
call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, data_tree);
/* restore saved state */
diff --git a/epan/dissectors/packet-openflow_v5.c b/epan/dissectors/packet-openflow_v5.c
index 46b81ab09e..083cbd52d7 100644
--- a/epan/dissectors/packet-openflow_v5.c
+++ b/epan/dissectors/packet-openflow_v5.c
@@ -2064,7 +2064,7 @@ dissect_openflow_packet_in_v5(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
/* dissect data */
col_set_writable(pinfo->cinfo, FALSE);
- next_tvb = tvb_new_subset(tvb, offset, length - offset, length - offset);
+ next_tvb = tvb_new_subset_length(tvb, offset, length - offset);
call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, data_tree);
/* restore saved state */
@@ -2809,7 +2809,7 @@ dissect_openflow_packet_out_v5(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
/* dissect data */
col_set_writable(pinfo->cinfo, FALSE);
- next_tvb = tvb_new_subset(tvb, offset, length - offset, length - offset);
+ next_tvb = tvb_new_subset_length(tvb, offset, length - offset);
call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, data_tree);
/* restore saved state */
diff --git a/epan/dissectors/packet-openwire.c b/epan/dissectors/packet-openwire.c
index 588cbdea9b..3d76fa8bbc 100644
--- a/epan/dissectors/packet-openwire.c
+++ b/epan/dissectors/packet-openwire.c
@@ -863,7 +863,7 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
if (parentType == OPENWIRE_ACTIVEMQ_TEXT_MESSAGE)
{
dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_none, OPENWIRE_TYPE_BIG_STRING, type, FALSE);
- next_tvb = tvb_new_subset(tvb, offset, iArrayLength, iArrayLength);
+ next_tvb = tvb_new_subset_length(tvb, offset, iArrayLength);
add_new_data_source(pinfo, next_tvb, "Body");
}
else if (parentType == OPENWIRE_ACTIVEMQ_MAP_MESSAGE)
@@ -882,7 +882,7 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
|| parentType == OPENWIRE_ACTIVEMQ_OBJECT_MESSAGE
|| parentType == OPENWIRE_ACTIVEMQ_BLOB_MESSAGE)
{
- next_tvb = tvb_new_subset(tvb, offset, iArrayLength, iArrayLength);
+ next_tvb = tvb_new_subset_length(tvb, offset, iArrayLength);
add_new_data_source(pinfo, next_tvb, "Body");
expert_add_info(pinfo, array_item, &ei_openwire_body_type_not_supported);
}
diff --git a/epan/dissectors/packet-ossp.c b/epan/dissectors/packet-ossp.c
index 92776d47eb..6343c8df9e 100644
--- a/epan/dissectors/packet-ossp.c
+++ b/epan/dissectors/packet-ossp.c
@@ -528,7 +528,7 @@ dissect_esmc_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *treex)
{
proto_item* item_b;
tvbuff_t* tvb_next;
- tvb_next = tvb_new_subset(tvb, offset, padding_size, -1);
+ tvb_next = tvb_new_subset_remaining(tvb, offset);
item_b = proto_tree_add_item(tree_a, hf_esmc_padding, tvb_next, 0, -1, ENC_NA);
proto_item_append_text(item_b, ", %d %s%s", padding_size
, "octet", plurality(padding_size,"","s"));
diff --git a/epan/dissectors/packet-packetlogger.c b/epan/dissectors/packet-packetlogger.c
index d4eb116162..d589c9a6b5 100644
--- a/epan/dissectors/packet-packetlogger.c
+++ b/epan/dissectors/packet-packetlogger.c
@@ -84,7 +84,7 @@ static void dissect_packetlogger (tvbuff_t *tvb, packet_info *pinfo, proto_tree
proto_item_append_text (ti, " %s", val_to_str (pl_type, type_vals, "Unknown 0x%02x"));
len = tvb_length_remaining (tvb, 1);
- next_tvb = tvb_new_subset (tvb, 1, len, len);
+ next_tvb = tvb_new_subset_remaining (tvb, 1);
if (pl_type <= PKT_RECV_ACL_DATA) {
/* HCI H1 packages */
diff --git a/epan/dissectors/packet-pana.c b/epan/dissectors/packet-pana.c
index 54b199f6e9..a2c4afb1a5 100644
--- a/epan/dissectors/packet-pana.c
+++ b/epan/dissectors/packet-pana.c
@@ -471,7 +471,7 @@ dissect_avps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *avp_tree)
tvb, offset, avp_data_length,
"AVP Value (EAP packet)");
avp_eap_tree = proto_item_add_subtree(avp_eap_item, ett_pana_avp);
- eap_tvb = tvb_new_subset(tvb, offset, avp_data_length, avp_data_length);
+ eap_tvb = tvb_new_subset_length(tvb, offset, avp_data_length);
if (eap_handle != NULL) {
call_dissector(eap_handle, eap_tvb, pinfo, avp_eap_tree);
}
@@ -482,7 +482,7 @@ dissect_avps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *avp_tree)
tvb, offset, avp_data_length,
"AVP Value (PANA packet)");
avp_encap_tree = proto_item_add_subtree(avp_encap_item, ett_pana_avp);
- encap_tvb = tvb_new_subset(tvb, offset, avp_data_length, avp_data_length);
+ encap_tvb = tvb_new_subset_length(tvb, offset, avp_data_length);
dissect_pana_pdu(encap_tvb, pinfo, avp_encap_tree);
break;
}
@@ -640,7 +640,7 @@ dissect_pana_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvbuff_t *avp_tvb;
proto_tree *avp_tree;
proto_item *avp_item;
- avp_tvb = tvb_new_subset(tvb, offset, avp_length, avp_length);
+ avp_tvb = tvb_new_subset_length(tvb, offset, avp_length);
avp_item = proto_tree_add_text(pana_tree, tvb, offset, avp_length, "Attribute Value Pairs");
avp_tree = proto_item_add_subtree(avp_item, ett_pana_avp);
diff --git a/epan/dissectors/packet-pdc.c b/epan/dissectors/packet-pdc.c
index 1e20ca3800..3084c14e41 100644
--- a/epan/dissectors/packet-pdc.c
+++ b/epan/dissectors/packet-pdc.c
@@ -240,7 +240,7 @@ static int dissect_admpdu(tvbuff_t *tvb, proto_tree *parent_tree, proto_tree *tr
offset += 2;
returnLen = userDataLen + 6;
- asterixTVB = tvb_new_subset(tvb, offset, userDataLen, userDataLen);
+ asterixTVB = tvb_new_subset_length(tvb, offset, userDataLen);
if (asterix_handle != NULL)
call_dissector(asterix_handle, asterixTVB, pinfo, parent_tree);
@@ -262,7 +262,7 @@ static int dissect_dtmpdu(tvbuff_t *tvb, proto_tree *parent_tree, proto_tree *tr
/* length of user data field */
userDataLen = tvb_get_ntohs(tvb, 2);
returnLen = userDataLen + 2;
- asterixTVB = tvb_new_subset(tvb, offset + 2, userDataLen, userDataLen);
+ asterixTVB = tvb_new_subset_length(tvb, offset + 2, userDataLen);
if (asterix_handle != NULL)
call_dissector(asterix_handle, asterixTVB, pinfo, parent_tree);
@@ -284,7 +284,7 @@ static int dissect_edmpdu(tvbuff_t *tvb, proto_tree *parent_tree, proto_tree *tr
/* length of user data field */
userDataLen = tvb_get_ntohs(tvb, 2);
returnLen = userDataLen + 2;
- asterixTVB = tvb_new_subset(tvb, offset + 2, userDataLen, userDataLen);
+ asterixTVB = tvb_new_subset_length(tvb, offset + 2, userDataLen);
if (asterix_handle != NULL)
call_dissector(asterix_handle, asterixTVB, pinfo, parent_tree);
diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c
index 6fb991712a..2a343dc02c 100644
--- a/epan/dissectors/packet-per.c
+++ b/epan/dissectors/packet-per.c
@@ -2322,7 +2322,7 @@ DEBUG_ENTRY("dissect_per_octet_string");
}
if (value_tvb)
- *value_tvb = (out_tvb) ? out_tvb : tvb_new_subset(tvb, val_start, val_length, val_length);
+ *value_tvb = (out_tvb) ? out_tvb : tvb_new_subset_length(tvb, val_start, val_length);
return offset;
}
diff --git a/epan/dissectors/packet-ppp.c b/epan/dissectors/packet-ppp.c
index 89b9fc0acd..c2e225f558 100644
--- a/epan/dissectors/packet-ppp.c
+++ b/epan/dissectors/packet-ppp.c
@@ -3945,7 +3945,7 @@ dissect_cp(tvbuff_t *tvb, int proto_id, int proto_subtree_index,
pinfo->flags.in_error_pkt = TRUE;
/* Decode the rejected packet. */
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
if (!dissector_try_uint(ppp_subdissector_table, protocol, next_tvb,
pinfo, fh_tree)) {
call_dissector(data_handle, next_tvb, pinfo, fh_tree);
@@ -4520,7 +4520,7 @@ dissect_pppmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
sub_ti = proto_tree_add_text(sub_tree, tvb,offset, length,
"Information Field");
info_tree = proto_item_add_subtree(sub_ti, ett_pppmux_subframe_info);
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
if (!dissector_try_uint(ppp_subdissector_table, pid, next_tvb, pinfo,
info_tree)) {
diff --git a/epan/dissectors/packet-pw-atm.c b/epan/dissectors/packet-pw-atm.c
index 3c20a1c4e9..7b862c3e91 100644
--- a/epan/dissectors/packet-pw-atm.c
+++ b/epan/dissectors/packet-pw-atm.c
@@ -649,7 +649,7 @@ dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
{
tvbuff_t* tvb_2;
- tvb_2 = tvb_new_subset(tvb, 0, PWC_SIZEOF_CW, PWC_SIZEOF_CW);
+ tvb_2 = tvb_new_subset_length(tvb, 0, PWC_SIZEOF_CW);
call_dissector_with_data(dh_control_word, tvb_2, pinfo, tree, &pd);
tvb_2 = tvb_new_subset_remaining(tvb, (PWC_SIZEOF_CW-1));
@@ -857,7 +857,7 @@ dissect_aal5_sdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
{
tvbuff_t* tvb_2;
- tvb_2 = tvb_new_subset(tvb, 0, PWC_SIZEOF_CW, PWC_SIZEOF_CW);
+ tvb_2 = tvb_new_subset_length(tvb, 0, PWC_SIZEOF_CW);
call_dissector_with_data(dh_control_word, tvb_2, pinfo, tree, &pd);
tvb_2 = tvb_new_subset_remaining(tvb, PWC_SIZEOF_CW);
@@ -873,7 +873,7 @@ dissect_aal5_sdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
union wtap_pseudo_header* pseudo_header_save;
union wtap_pseudo_header ph;
- tvb_3 = tvb_new_subset(tvb_2, 0, payload_size, payload_size);
+ tvb_3 = tvb_new_subset_length(tvb_2, 0, payload_size);
/* prepare pseudo header for atm aal5 decoding */
pseudo_header_save = pinfo->pseudo_header;
pinfo->pseudo_header = &ph;
@@ -1039,7 +1039,7 @@ dissect_n1_cw(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
{
tvbuff_t* tvb_2;
- tvb_2 = tvb_new_subset(tvb, 0, PWC_SIZEOF_CW, PWC_SIZEOF_CW);
+ tvb_2 = tvb_new_subset_length(tvb, 0, PWC_SIZEOF_CW);
call_dissector_with_data(dh_control_word, tvb_2, pinfo, tree, &pd);
tvb_2 = tvb_new_subset_remaining(tvb, PWC_SIZEOF_CW);
diff --git a/epan/dissectors/packet-pw-cesopsn.c b/epan/dissectors/packet-pw-cesopsn.c
index f07a85b108..17bd89878b 100644
--- a/epan/dissectors/packet-pw-cesopsn.c
+++ b/epan/dissectors/packet-pw-cesopsn.c
@@ -263,7 +263,7 @@ void dissect_pw_cesopsn( tvbuff_t * tvb_original
{
tvbuff_t* tvb;
proto_item* item2;
- tvb = tvb_new_subset(tvb_original, 0, PWC_SIZEOF_CW, PWC_SIZEOF_CW);
+ tvb = tvb_new_subset_length(tvb_original, 0, PWC_SIZEOF_CW);
item2 = proto_tree_add_item(tree2, hf_cw, tvb, 0, -1, ENC_NA);
pwc_item_append_cw(item2,tvb_get_ntohl(tvb, 0),FALSE);
{
@@ -339,7 +339,7 @@ void dissect_pw_cesopsn( tvbuff_t * tvb_original
{
proto_item* item2;
tvbuff_t* tvb;
- tvb = tvb_new_subset(tvb_original, PWC_SIZEOF_CW, payload_size, payload_size);
+ tvb = tvb_new_subset_length(tvb_original, PWC_SIZEOF_CW, payload_size);
item2 = proto_tree_add_item(tree2, hf_payload, tvb, 0, -1, ENC_NA);
pwc_item_append_text_n_items(item2,(int)payload_size,"octet");
if (properties & PWC_PAY_SIZE_BAD)
diff --git a/epan/dissectors/packet-pw-fr.c b/epan/dissectors/packet-pw-fr.c
index d9e77d3dfa..4d96a134ef 100644
--- a/epan/dissectors/packet-pw-fr.c
+++ b/epan/dissectors/packet-pw-fr.c
@@ -240,7 +240,7 @@ dissect_pw_fr( tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree )
if (payload_size > 0)
{
tvbuff_t *tvb_payload;
- tvb_payload = tvb_new_subset(tvb, encaps_size, payload_size, payload_size);
+ tvb_payload = tvb_new_subset_length(tvb, encaps_size, payload_size);
call_dissector( fr_stripped_address_handle, tvb_payload, pinfo, tree );
}
return;
diff --git a/epan/dissectors/packet-pw-satop.c b/epan/dissectors/packet-pw-satop.c
index a557d34614..5b06993a9b 100644
--- a/epan/dissectors/packet-pw-satop.c
+++ b/epan/dissectors/packet-pw-satop.c
@@ -260,7 +260,7 @@ void dissect_pw_satop(tvbuff_t * tvb_original
{
tvbuff_t* tvb;
proto_item* item2;
- tvb = tvb_new_subset(tvb_original, 0, PWC_SIZEOF_CW, PWC_SIZEOF_CW);
+ tvb = tvb_new_subset_length(tvb_original, 0, PWC_SIZEOF_CW);
item2 = proto_tree_add_item(tree2, hf_cw, tvb, 0, -1, ENC_NA);
pwc_item_append_cw(item2, tvb_get_ntohl(tvb, 0),FALSE);
{
@@ -333,7 +333,7 @@ void dissect_pw_satop(tvbuff_t * tvb_original
{
proto_item* item2;
tvbuff_t* tvb;
- tvb = tvb_new_subset(tvb_original, PWC_SIZEOF_CW, payload_size, payload_size);
+ tvb = tvb_new_subset_length(tvb_original, PWC_SIZEOF_CW, payload_size);
item2 = proto_tree_add_item(tree2, hf_payload, tvb, 0, -1, ENC_NA);
pwc_item_append_text_n_items(item2,(int)payload_size,"octet");
{
diff --git a/epan/dissectors/packet-q931.c b/epan/dissectors/packet-q931.c
index f32b9511a3..493dbde58e 100644
--- a/epan/dissectors/packet-q931.c
+++ b/epan/dissectors/packet-q931.c
@@ -2409,7 +2409,7 @@ dissect_q931_user_user_ie(tvbuff_t *tvb, packet_info *pinfo, int offset, int len
switch (octet) {
case Q931_PROTOCOL_DISCRIMINATOR_USER:
- next_tvb = tvb_new_subset(tvb, offset, len, len);
+ next_tvb = tvb_new_subset_length(tvb, offset, len);
proto_tree_add_uint_format_value(tree, hf_q931_user_information_len, tvb, offset, len, len, "%d octets", len);
if (!dissector_try_heuristic(q931_user_heur_subdissector_list, next_tvb, pinfo, tree, &hdtbl_entry, NULL)) {
call_dissector_only(data_handle, next_tvb, pinfo, tree, NULL);
@@ -2664,7 +2664,7 @@ dissect_q931_IEs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root_tree,
*/
if (dissector_get_uint_handle(codeset_dissector_table, codeset) ||
dissector_get_uint_handle(ie_dissector_table, (codeset << 8) | (info_element & Q931_IE_SO_IDENTIFIER_MASK))) {
- next_tvb = tvb_new_subset (tvb, offset, 1, 1);
+ next_tvb = tvb_new_subset_length (tvb, offset, 1);
if (dissector_try_uint(ie_dissector_table, (codeset << 8) | (info_element & Q931_IE_SO_IDENTIFIER_MASK), next_tvb, pinfo, q931_tree) ||
dissector_try_uint(codeset_dissector_table, codeset, next_tvb, pinfo, q931_tree)) {
offset += 1;
@@ -2767,9 +2767,8 @@ dissect_q931_IEs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root_tree,
* whether we're building a
* protocol tree or not.
*/
- h225_tvb = tvb_new_subset(tvb,
- offset + 4, info_element_len - 1,
- info_element_len - 1);
+ h225_tvb = tvb_new_subset_length(tvb,
+ offset + 4, info_element_len - 1);
call_dissector(h225_handle, h225_tvb,
pinfo, root_tree);
} else {
@@ -2796,7 +2795,7 @@ dissect_q931_IEs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root_tree,
*/
if (dissector_get_uint_handle(codeset_dissector_table, codeset) ||
dissector_get_uint_handle(ie_dissector_table, (codeset << 8) | info_element)) {
- next_tvb = tvb_new_subset (tvb, offset, info_element_len + 2, info_element_len + 2);
+ next_tvb = tvb_new_subset_length (tvb, offset, info_element_len + 2);
if (dissector_try_uint(ie_dissector_table, (codeset << 8) | info_element, next_tvb, pinfo, q931_tree) ||
dissector_try_uint(codeset_dissector_table, codeset, next_tvb, pinfo, q931_tree)) {
offset += 2 + info_element_len;
diff --git a/epan/dissectors/packet-q932-ros.c b/epan/dissectors/packet-q932-ros.c
index 8e7d06b5b8..59a37a30eb 100644
--- a/epan/dissectors/packet-q932-ros.c
+++ b/epan/dissectors/packet-q932-ros.c
@@ -251,7 +251,7 @@ dissect_q932_ros_InvokeArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
len = tvb_length_remaining(tvb, offset);
if (len)
proto_tree_add_item(tree, hf_index, tvb, offset, len, ENC_NA);
- arg_next_tvb = tvb_new_subset(tvb, offset, len, len);
+ arg_next_tvb = tvb_new_subset_remaining(tvb, offset);
offset += tvb_length_remaining(tvb, offset);
@@ -329,7 +329,7 @@ dissect_q932_ros_ResultArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
len = tvb_length_remaining(tvb, offset);
if (len)
proto_tree_add_item(tree, hf_index, tvb, offset, len, ENC_NA);
- res_next_tvb = tvb_new_subset(tvb, offset, len, len);
+ res_next_tvb = tvb_new_subset_remaining(tvb, offset);
offset += tvb_length_remaining(tvb, offset);
@@ -425,7 +425,7 @@ dissect_q932_ros_T_parameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
len = tvb_length_remaining(tvb, offset);
if (len)
proto_tree_add_item(tree, hf_index, tvb, offset, len, ENC_NA);
- err_next_tvb = tvb_new_subset(tvb, offset, len, len);
+ err_next_tvb = tvb_new_subset_remaining(tvb, offset);
offset += tvb_length_remaining(tvb, offset);
diff --git a/epan/dissectors/packet-q932.c b/epan/dissectors/packet-q932.c
index eab682fc2d..5b04993d82 100644
--- a/epan/dissectors/packet-q932.c
+++ b/epan/dissectors/packet-q932.c
@@ -665,7 +665,7 @@ dissect_q932_facility_ie(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
offset = get_ber_identifier(tvb, offset, &appclass, &pc, &tag);
offset = get_ber_length(tvb, offset, &len, NULL);
eoffset = offset + len;
- next_tvb = tvb_new_subset(tvb, hoffset, eoffset - hoffset, eoffset - hoffset);
+ next_tvb = tvb_new_subset_length(tvb, hoffset, eoffset - hoffset);
switch (appclass) {
case BER_CLASS_CON:
switch (tag) {
diff --git a/epan/dissectors/packet-quake.c b/epan/dissectors/packet-quake.c
index a89a93da45..f704318b2b 100644
--- a/epan/dissectors/packet-quake.c
+++ b/epan/dissectors/packet-quake.c
@@ -359,7 +359,6 @@ dissect_quake_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 command;
int direction;
proto_tree *control_tree = NULL;
- guint rest_length;
tvbuff_t *next_tvb;
command = tvb_get_guint8(tvb, 0);
@@ -380,8 +379,7 @@ dissect_quake_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb, 0, 1, command);
}
- rest_length = tvb_reported_length(tvb) - 1;
- next_tvb = tvb_new_subset(tvb, 1, rest_length , rest_length);
+ next_tvb = tvb_new_subset_remaining(tvb, 1);
switch (command) {
case CCREQ_CONNECT:
dissect_quake_CCREQ_CONNECT
@@ -432,7 +430,6 @@ dissect_quake(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *quake_tree = NULL;
guint16 flags;
guint32 sequence = 0;
- guint rest_length;
tvbuff_t *next_tvb;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "QUAKE");
@@ -466,8 +463,7 @@ dissect_quake(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (flags == NETFLAG_CTL) {
- rest_length = tvb_reported_length(tvb) - 4;
- next_tvb = tvb_new_subset(tvb, 4, rest_length , rest_length);
+ next_tvb = tvb_new_subset_remaining(tvb, 4);
dissect_quake_control(next_tvb, pinfo, quake_tree);
return;
}
@@ -477,8 +473,7 @@ dissect_quake(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(quake_tree, hf_quake_header_sequence,
tvb, 4, 4, sequence);
- rest_length = tvb_reported_length(tvb) - 8;
- next_tvb = tvb_new_subset(tvb, 8, rest_length , rest_length);
+ next_tvb = tvb_new_subset_remaining(tvb, 8);
call_dissector(data_handle,next_tvb, pinfo, quake_tree);
}
diff --git a/epan/dissectors/packet-quake2.c b/epan/dissectors/packet-quake2.c
index 1ca88c545d..b9a99022c8 100644
--- a/epan/dissectors/packet-quake2.c
+++ b/epan/dissectors/packet-quake2.c
@@ -398,8 +398,7 @@ dissect_quake2_client_commands(tvbuff_t *tvb, packet_info *pinfo,
offset++;
rest_length = tvb_reported_length(tvb) - offset;
if (rest_length)
- next_tvb = tvb_new_subset(tvb, offset,
- rest_length, rest_length);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
else
return;
@@ -499,7 +498,7 @@ dissect_quake2_server_commands(tvbuff_t *tvb, packet_info *pinfo,
offset++;
rest_length = tvb_reported_length(tvb) - offset;
if (rest_length)
- next_tvb = tvb_new_subset(tvb, offset, rest_length, rest_length);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
else
return;
@@ -636,7 +635,7 @@ dissect_quake2_GamePacket(tvbuff_t *tvb, packet_info *pinfo,
rest_length = tvb_reported_length(tvb) - offset;
if (rest_length) {
tvbuff_t *next_tvb =
- tvb_new_subset(tvb, offset, rest_length , rest_length);
+ tvb_new_subset_remaining(tvb, offset);
if (direction == DIR_C2S) {
proto_tree *c_tree = NULL;
diff --git a/epan/dissectors/packet-quake3.c b/epan/dissectors/packet-quake3.c
index 3b8bfc328f..90459ec3f5 100644
--- a/epan/dissectors/packet-quake3.c
+++ b/epan/dissectors/packet-quake3.c
@@ -430,8 +430,7 @@ dissect_quake3_GamePacket(tvbuff_t *tvb, packet_info *pinfo,
/* all the rest is pure game data */
rest_length = tvb_reported_length(tvb) - offset;
if (rest_length) {
- tvbuff_t *next_tvb =
- tvb_new_subset(tvb, offset, rest_length , rest_length);
+ tvbuff_t *next_tvb = tvb_new_subset_remaining(tvb, offset);
if (*direction == DIR_C2S) {
proto_tree *c_tree = NULL;
diff --git a/epan/dissectors/packet-quakeworld.c b/epan/dissectors/packet-quakeworld.c
index 4ceb8a4fad..774a56c436 100644
--- a/epan/dissectors/packet-quakeworld.c
+++ b/epan/dissectors/packet-quakeworld.c
@@ -638,8 +638,7 @@ dissect_quakeworld_GamePacket(tvbuff_t *tvb, packet_info *pinfo,
/* all the rest is pure game data */
rest_length = tvb_reported_length(tvb) - offset;
if (rest_length) {
- tvbuff_t *next_tvb =
- tvb_new_subset(tvb, offset, rest_length , rest_length);
+ tvbuff_t *next_tvb = tvb_new_subset_remaining(tvb, offset);
if (direction == DIR_C2S) {
proto_tree *c_tree = NULL;
diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c
index 7cc440eb11..0653b9b6a2 100644
--- a/epan/dissectors/packet-radius.c
+++ b/epan/dissectors/packet-radius.c
@@ -954,7 +954,7 @@ static void add_avp_to_tree(proto_tree* avp_tree, proto_item* avp_item, packet_i
tvbuff_t* tvb_value;
const gchar* str;
- tvb_value = tvb_new_subset(tvb, offset, avp_length, (gint) avp_length);
+ tvb_value = tvb_new_subset_length(tvb, offset, avp_length);
str = dictionary_entry->dissector(avp_tree,tvb_value,pinfo);
diff --git a/epan/dissectors/packet-rfid-pn532-hci.c b/epan/dissectors/packet-rfid-pn532-hci.c
index 7ac704b014..fe81c5b130 100644
--- a/epan/dissectors/packet-rfid-pn532-hci.c
+++ b/epan/dissectors/packet-rfid-pn532-hci.c
@@ -135,7 +135,7 @@ dissect_pn532_hci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
}
offset += 1;
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector_with_data(pn532_handle, next_tvb, pinfo, tree, usb_conv_info);
offset += length;
@@ -162,7 +162,7 @@ dissect_pn532_hci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
proto_tree_add_expert(main_tree, pinfo, &ei_invalid_length_checksum, tvb, offset, 1);
offset += 1;
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector_with_data(pn532_handle, next_tvb, pinfo, tree, usb_conv_info);
offset += length;
diff --git a/epan/dissectors/packet-rfid-pn532.c b/epan/dissectors/packet-rfid-pn532.c
index 7b0bfd646f..6dc81c8e43 100644
--- a/epan/dissectors/packet-rfid-pn532.c
+++ b/epan/dissectors/packet-rfid-pn532.c
@@ -1242,7 +1242,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
break;
case FELICA_212:
case FELICA_424:
- next_tvb = tvb_new_subset(tvb, offset, 5, 5);
+ next_tvb = tvb_new_subset_length(tvb, offset, 5);
call_dissector(sub_handles[SUB_FELICA], next_tvb, pinfo, tree);
offset += 5;
break;
diff --git a/epan/dissectors/packet-rlc-lte.c b/epan/dissectors/packet-rlc-lte.c
index ceef971d1b..7e703155b2 100644
--- a/epan/dissectors/packet-rlc-lte.c
+++ b/epan/dissectors/packet-rlc-lte.c
@@ -782,7 +782,7 @@ static void show_PDU_in_tree(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb
/* Get tvb for passing to LTE PDCP dissector */
if (reassembly_info == NULL) {
- pdcp_tvb = tvb_new_subset(tvb, offset, length, length);
+ pdcp_tvb = tvb_new_subset_length(tvb, offset, length);
}
else {
/* Get combined tvb. */
@@ -849,7 +849,7 @@ static void show_PDU_in_tree(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb
/* Get tvb for passing to LTE RRC dissector */
if (reassembly_info == NULL) {
- rrc_tvb = tvb_new_subset(tvb, offset, length, length);
+ rrc_tvb = tvb_new_subset_length(tvb, offset, length);
}
else {
/* Get combined tvb. */
@@ -875,7 +875,7 @@ static void show_PDU_in_tree(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb
/* Get tvb for passing to IP dissector */
if (reassembly_info == NULL) {
- ip_tvb = tvb_new_subset(tvb, offset, length, length);
+ ip_tvb = tvb_new_subset_length(tvb, offset, length);
}
else {
/* Get combined tvb. */
diff --git a/epan/dissectors/packet-rpcap.c b/epan/dissectors/packet-rpcap.c
index 20e7922d1b..c58ce9de5c 100644
--- a/epan/dissectors/packet-rpcap.c
+++ b/epan/dissectors/packet-rpcap.c
@@ -989,7 +989,7 @@ dissect_rpcap (tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree, void* da
if (len) {
/* Yet unknown, dump as data */
proto_item_set_len (ti, 8);
- new_tvb = tvb_new_subset (tvb, offset, len, len);
+ new_tvb = tvb_new_subset_remaining (tvb, offset);
call_dissector (data_handle, new_tvb, pinfo, top_tree);
}
break;
diff --git a/epan/dissectors/packet-rsl.c b/epan/dissectors/packet-rsl.c
index 5f5508b8cb..6de3e48886 100644
--- a/epan/dissectors/packet-rsl.c
+++ b/epan/dissectors/packet-rsl.c
@@ -1306,14 +1306,14 @@ dissect_rsl_ie_L3_inf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
{
/* L3 PDUs carried on CCCH have L2 PSEUDO LENGTH octet or are RR Short PD format */
proto_tree_add_text(ie_tree, tvb,offset,length,"Link Layer Service Data Unit (L3 Message)(CCCH)");
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector(gsm_a_ccch_handle, next_tvb, pinfo, top_tree);
}
else if (type == L3_INF_SACCH)
{
/* L3 PDUs carried on SACCH are normal format or are RR Short PD format */
proto_tree_add_text(ie_tree, tvb,offset,length,"Link Layer Service Data Unit (L3 Message)(SACCH)");
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector(gsm_a_sacch_handle, next_tvb, pinfo, top_tree);
}
else
@@ -1322,7 +1322,7 @@ dissect_rsl_ie_L3_inf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
* as defined in 3GPP TS 24.008 or 3GPP TS 44.018)
*/
proto_tree_add_text(ie_tree, tvb,offset,length,"Link Layer Service Data Unit (L3 Message)");
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector(gsm_a_dtap_handle, next_tvb, pinfo, top_tree);
}
@@ -2118,7 +2118,7 @@ dissect_rsl_ie_full_imm_ass_inf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
* as defined in 3GPP TS 44.018.
*/
proto_tree_add_text(ie_tree, tvb,offset,length,"Full Immediate Assign Info field");
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector(gsm_a_ccch_handle, next_tvb, pinfo, top_tree);
offset = offset + length;
@@ -2163,7 +2163,7 @@ dissect_rsl_ie_smscb_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
/*
* SMSCB frame
*/
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector(gsm_cbch_handle, next_tvb, pinfo, top_tree);
offset = offset + length;
@@ -2279,7 +2279,7 @@ dissect_rsl_ie_full_bcch_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
*/
proto_tree_add_text(ie_tree, tvb,offset,length,"Layer 3 message");
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector(gsm_a_ccch_handle, next_tvb, pinfo, top_tree);
offset = offset + length;
@@ -2391,7 +2391,7 @@ dissect_rsl_ie_smscb_mess(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre
* SMSCB Message
*/
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector(gsm_cbs_handle, next_tvb, pinfo, top_tree);
offset = ie_offset + length;
diff --git a/epan/dissectors/packet-rsvp.c b/epan/dissectors/packet-rsvp.c
index d67d944a82..f4cd8a297b 100644
--- a/epan/dissectors/packet-rsvp.c
+++ b/epan/dissectors/packet-rsvp.c
@@ -7052,7 +7052,7 @@ dissect_rsvp_msg_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
gint sub_len;
tvbuff_t *tvb_sub;
sub_len = tvb_get_ntohs(tvb, len2+6);
- tvb_sub = tvb_new_subset(tvb, len2, sub_len, sub_len);
+ tvb_sub = tvb_new_subset_length(tvb, len2, sub_len);
dissect_rsvp_msg_tree(tvb_sub, pinfo, rsvp_tree, TREE(TT_BUNDLE_COMPMSG), rsvph, e2ei);
len2 += sub_len;
}
diff --git a/epan/dissectors/packet-rtcp.c b/epan/dissectors/packet-rtcp.c
index 3397e1f14f..0f1f420c7b 100644
--- a/epan/dissectors/packet-rtcp.c
+++ b/epan/dissectors/packet-rtcp.c
@@ -946,7 +946,7 @@ dissect_rtcp_rtpfb( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, proto_item
*/
if (packet_length > 12 &&
dissector_get_uint_handle (rtcp_rtpfb_dissector_table, rtcp_rtpfb_fmt)) {
- tvbuff_t *subtvb = tvb_new_subset(tvb, offset, packet_length - 12, packet_length - 12);
+ tvbuff_t *subtvb = tvb_new_subset_length(tvb, offset, packet_length - 12);
if (dissector_try_uint (rtcp_rtpfb_dissector_table, rtcp_rtpfb_fmt,
subtvb, pinfo, rtcp_tree))
@@ -1634,7 +1634,7 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree
/* tvb == Pass the entire APP payload so the subdissector can have access to the
* entire data set
*/
- next_tvb = tvb_new_subset(tvb, offset-8, app_length+4, app_length+4);
+ next_tvb = tvb_new_subset_length(tvb, offset-8, app_length+4);
/* look for registered sub-dissectors */
if (dissector_try_string(rtcp_dissector_table, ascii_name, next_tvb, pinfo, tree, NULL)) {
/* found subdissector - return tvb_length */
diff --git a/epan/dissectors/packet-rtmpt.c b/epan/dissectors/packet-rtmpt.c
index 24fd20bd3e..0bde57ae42 100644
--- a/epan/dissectors/packet-rtmpt.c
+++ b/epan/dissectors/packet-rtmpt.c
@@ -1921,7 +1921,7 @@ dissect_rtmpt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_
pktbuf = tvb_new_child_real_data(tvb, tp->data.p, tp->have, tp->have);
add_new_data_source(pinfo, pktbuf, "Unchunked RTMP");
} else {
- pktbuf = tvb_new_subset(tvb, tp->data.offset, tp->have, tp->have);
+ pktbuf = tvb_new_subset_length(tvb, tp->data.offset, tp->have);
}
dissect_rtmpt(pktbuf, pinfo, tree, rconv, cdir, tp);
}
@@ -2171,7 +2171,7 @@ dissect_rtmpt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_
wmem_tree_insert32(rconv->packets[cdir], tp->lastseq, tp);
- pktbuf = tvb_new_subset(tvb, tp->data.offset, tp->have, tp->have);
+ pktbuf = tvb_new_subset_length(tvb, tp->data.offset, tp->have);
dissect_rtmpt(pktbuf, pinfo, tree, rconv, cdir, tp);
offset += tp->want;
@@ -2435,7 +2435,7 @@ dissect_rtmpt_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
return;
if (offset > 0) {
- tvbuff_t *tvbrtmp = tvb_new_subset(tvb, offset, remain, remain);
+ tvbuff_t *tvbrtmp = tvb_new_subset_length(tvb, offset, remain);
dissect_rtmpt_common(tvbrtmp, pinfo, tree, rconv, cdir, seq, lastackseq);
} else {
dissect_rtmpt_common(tvb, pinfo, tree, rconv, cdir, seq, lastackseq);
diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c
index 6ca1e8d428..756cf91707 100644
--- a/epan/dissectors/packet-rtp.c
+++ b/epan/dissectors/packet-rtp.c
@@ -1463,7 +1463,7 @@ process_rtp_payload(tvbuff_t *newtvb, packet_info *pinfo, proto_tree *tree,
found_match = TRUE;
if (p_conv_data->bta2dp_info->content_protection_type == BTAVDTP_CONTENT_PROTECTION_TYPE_SCMS_T) {
- nexttvb = tvb_new_subset(newtvb, 0, 1, 1);
+ nexttvb = tvb_new_subset_length(newtvb, 0, 1);
call_dissector(bta2dp_content_protection_header_scms_t, nexttvb, pinfo, tree);
suboffset = 1;
}
@@ -1480,7 +1480,7 @@ process_rtp_payload(tvbuff_t *newtvb, packet_info *pinfo, proto_tree *tree,
found_match = TRUE;
if (p_conv_data->btvdp_info->content_protection_type == BTAVDTP_CONTENT_PROTECTION_TYPE_SCMS_T) {
- nexttvb = tvb_new_subset(newtvb, 0, 1, 1);
+ nexttvb = tvb_new_subset_length(newtvb, 0, 1);
call_dissector(btvdp_content_protection_header_scms_t, nexttvb, pinfo, tree);
suboffset = 1;
}
@@ -1841,7 +1841,7 @@ dissect_rtp_hext_rfc5215_onebyte( tvbuff_t *tvb, packet_info *pinfo,
}
ext_offset ++;
- subtvb = tvb_new_subset(tvb, ext_offset, ext_length, ext_length);
+ subtvb = tvb_new_subset_length(tvb, ext_offset, ext_length);
if (!dissector_try_uint (rtp_hdr_ext_rfc5285_dissector_table, ext_id, subtvb, pinfo, rtp_hext_rfc5285_tree)) {
if (rtp_hext_tree)
proto_tree_add_item(rtp_hext_rfc5285_tree, hf_rtp_ext_rfc5285_data, subtvb, 0, ext_length, ENC_NA );
@@ -1890,7 +1890,7 @@ dissect_rtp_hext_rfc5215_twobytes(tvbuff_t *parent_tvb, guint id_offset,
ext_offset += 2;
- subtvb = tvb_new_subset(tvb, ext_offset, ext_length, ext_length);
+ subtvb = tvb_new_subset_length(tvb, ext_offset, ext_length);
if (ext_length && !dissector_try_uint (rtp_hdr_ext_rfc5285_dissector_table, ext_id, subtvb, pinfo, rtp_hext_rfc5285_tree)) {
proto_tree_add_item(rtp_hext_rfc5285_tree, hf_rtp_ext_rfc5285_data, subtvb, 0, ext_length, ENC_NA );
}
@@ -2211,7 +2211,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
/* pass interpretation of header extension to a registered subdissector */
- newtvb = tvb_new_subset(tvb, offset, hdr_extension_len * 4, hdr_extension_len * 4);
+ newtvb = tvb_new_subset_length(tvb, offset, hdr_extension_len * 4);
if (hdr_extension_id == RTP_RFC5215_ONE_BYTE_SIG) {
dissect_rtp_hext_rfc5215_onebyte (newtvb, pinfo, rtp_hext_tree);
diff --git a/epan/dissectors/packet-rudp.c b/epan/dissectors/packet-rudp.c
index 8717ae59e3..549a6d07b1 100644
--- a/epan/dissectors/packet-rudp.c
+++ b/epan/dissectors/packet-rudp.c
@@ -130,7 +130,7 @@ dissect_rudp(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
/* If we have even more bytes their meaning is unknown - we have seen this
* in live captures */
if (hlen > 6) {
- next_tvb = tvb_new_subset(tvb, 6, hlen-6, hlen-6);
+ next_tvb = tvb_new_subset_length(tvb, 6, hlen-6);
call_dissector(data_handle, next_tvb, pinfo, rudp_tree);
}
}
diff --git a/epan/dissectors/packet-sabp.c b/epan/dissectors/packet-sabp.c
index c2c5f10abf..1f714c6ba2 100644
--- a/epan/dissectors/packet-sabp.c
+++ b/epan/dissectors/packet-sabp.c
@@ -1787,7 +1787,7 @@ dissect_sabp_cb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* octet 2 - 83 CBS-Message-Information-Page 1 */
cbs_page_item = proto_tree_add_item(subtree, hf_sabp_cb_msg_inf_page, tvb, offset, 82, ENC_BIG_ENDIAN);
cb_inf_msg_len = tvb_get_guint8(tvb,offset+82);
- page_tvb = tvb_new_subset(tvb, offset, cb_inf_msg_len, cb_inf_msg_len);
+ page_tvb = tvb_new_subset_length(tvb, offset, cb_inf_msg_len);
unpacked_tvb = dissect_cbs_data(sms_encoding, page_tvb, subtree, pinfo, 0);
len = tvb_length(unpacked_tvb);
if (unpacked_tvb != NULL){
diff --git a/epan/dissectors/packet-sccp.c b/epan/dissectors/packet-sccp.c
index 2e848e2da2..ce912feb99 100644
--- a/epan/dissectors/packet-sccp.c
+++ b/epan/dissectors/packet-sccp.c
@@ -1269,7 +1269,7 @@ looks_like_valid_sccp(guint32 frame_num _U_, tvbuff_t *tvb, guint8 my_mtp3_stand
if (param_len == 0)
RETURN_FALSE;
- param_tvb = tvb_new_subset(tvb, called_ptr+1, param_len, param_len);
+ param_tvb = tvb_new_subset_length(tvb, called_ptr+1, param_len);
if (!sccp_called_calling_looks_valid(frame_num, param_tvb, my_mtp3_standard, !is_connectionless(msgtype)))
RETURN_FALSE;
@@ -1281,7 +1281,7 @@ looks_like_valid_sccp(guint32 frame_num _U_, tvbuff_t *tvb, guint8 my_mtp3_stand
if (param_len == 0)
RETURN_FALSE;
- param_tvb = tvb_new_subset(tvb, calling_ptr+1, param_len, param_len);
+ param_tvb = tvb_new_subset_length(tvb, calling_ptr+1, param_len);
if (!sccp_called_calling_looks_valid(frame_num, param_tvb, my_mtp3_standard, !is_connectionless(msgtype)))
RETURN_FALSE;
@@ -1770,8 +1770,7 @@ dissect_sccp_global_title(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
if (length < offset)
return;
- signals_tvb = tvb_new_subset(tvb, offset, (length - offset),
- (length - offset));
+ signals_tvb = tvb_new_subset_length(tvb, offset, (length - offset));
digits_tree = dissect_sccp_gt_address_information(signals_tvb, pinfo, gt_tree,
(length - offset),
@@ -2005,8 +2004,7 @@ dissect_sccp_called_calling_param(tvbuff_t *tvb, proto_tree *tree, packet_info *
if (length < offset)
return;
- gt_tvb = tvb_new_subset(tvb, offset, (length - offset),
- (length - offset));
+ gt_tvb = tvb_new_subset_length(tvb, offset, (length - offset));
dissect_sccp_global_title(gt_tvb, pinfo, call_tree, (length - offset), gti,
(routing_ind == ROUTE_ON_GT), called);
}
@@ -2071,8 +2069,7 @@ dissect_sccp_called_calling_param(tvbuff_t *tvb, proto_tree *tree, packet_info *
if (gti != AI_GTI_NO_GT) {
if (length < offset)
return;
- gt_tvb = tvb_new_subset(tvb, offset, (length - offset),
- (length - offset));
+ gt_tvb = tvb_new_subset_length(tvb, offset, (length - offset));
dissect_sccp_global_title(gt_tvb, pinfo, call_tree, (length - offset), gti,
(routing_ind == ROUTE_ON_GT), called);
}
@@ -2522,7 +2519,7 @@ dissect_sccp_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
}
- parameter_tvb = tvb_new_subset(tvb, offset, parameter_length, parameter_length);
+ parameter_tvb = tvb_new_subset_length(tvb, offset, parameter_length);
switch (parameter_type) {
diff --git a/epan/dissectors/packet-scsi-osd.c b/epan/dissectors/packet-scsi-osd.c
index 4aad143673..73a71fd2aa 100644
--- a/epan/dissectors/packet-scsi-osd.c
+++ b/epan/dissectors/packet-scsi-osd.c
@@ -460,7 +460,7 @@ dissect_osd_attribute_list_entry(packet_info *pinfo, tvbuff_t *tvb,
proto_tree_add_expert_format(tree, pinfo, &ei_osd_attr_length_invalid,
tvb, 0, attribute_length, "%s", apn->name);
} else {
- tvbuff_t *next_tvb = tvb_new_subset(tvb, offset, attribute_length, attribute_length);
+ tvbuff_t *next_tvb = tvb_new_subset_length(tvb, offset, attribute_length);
apn->dissector(next_tvb, pinfo, tree, lun_info, apn);
}
}
diff --git a/epan/dissectors/packet-sdp.c b/epan/dissectors/packet-sdp.c
index 7b5fad4bf0..16414e0172 100644
--- a/epan/dissectors/packet-sdp.c
+++ b/epan/dissectors/packet-sdp.c
@@ -2013,8 +2013,7 @@ setup_sdp_transport(tvbuff_t *tvb, packet_info *pinfo, enum sdp_exchange_type ex
if (hf != hf_unknown)
{
DINDENT();
- call_sdp_subdissector(tvb_new_subset(tvb, offset + tokenoffset,
- linelen - tokenoffset,
+ call_sdp_subdissector(tvb_new_subset_length(tvb, offset + tokenoffset,
linelen - tokenoffset),
pinfo,
hf, NULL, linelen-tokenoffset, transport_info, &media_info);
@@ -2412,8 +2411,7 @@ dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
sub_ti = proto_tree_add_string(sdp_tree, hf, tvb, offset, linelen,
string);
- call_sdp_subdissector(tvb_new_subset(tvb, offset + tokenoffset,
- linelen - tokenoffset,
+ call_sdp_subdissector(tvb_new_subset_length(tvb, offset + tokenoffset,
linelen - tokenoffset),
pinfo,
hf, sub_ti, linelen-tokenoffset,
diff --git a/epan/dissectors/packet-selfm.c b/epan/dissectors/packet-selfm.c
index d400d4e166..2225904ef8 100644
--- a/epan/dissectors/packet-selfm.c
+++ b/epan/dissectors/packet-selfm.c
@@ -2538,7 +2538,7 @@ dissect_selfm_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
selfm_tvb = clean_telnet_iac(pinfo, tvb, 0, length);
}
else {
- selfm_tvb = tvb_new_subset( tvb, 0, length, length);
+ selfm_tvb = tvb_new_subset_length( tvb, 0, length);
}
diff --git a/epan/dissectors/packet-sercosiii.c b/epan/dissectors/packet-sercosiii.c
index 85241ad3b8..8b80b519a7 100644
--- a/epan/dissectors/packet-sercosiii.c
+++ b/epan/dissectors/packet-sercosiii.c
@@ -900,13 +900,13 @@ static void dissect_siii_mdt_cp1_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree
for (idx = 0; idx < SERCOS_SLAVE_GROUP_SIZE; ++idx) /* each MDT of CP1/2 has data for 128 different slaves */
{
- tvb_n = tvb_new_subset(tvb, 6 * idx, 6, 6); /* subset for service channel data */
+ tvb_n = tvb_new_subset_length(tvb, 6 * idx, 6); /* subset for service channel data */
ti = proto_tree_add_text(subtree_svc, tvb_n, 0, 6, "Device %u", idx + devstart);
subtree = proto_item_add_subtree(ti, ett_siii_mdt_svc_channel);
dissect_siii_mdt_svc(tvb_n, pinfo, subtree, idx + devstart);
- tvb_n = tvb_new_subset(tvb, SERCOS_SLAVE_GROUP_SIZE * 6 + 4 * idx, 2, 2); /* subset for device control information */
+ tvb_n = tvb_new_subset_length(tvb, SERCOS_SLAVE_GROUP_SIZE * 6 + 4 * idx, 2); /* subset for device control information */
ti = proto_tree_add_text(subtree_devctrl, tvb_n, 0, 2, "Device %u", idx + devstart);
subtree = proto_item_add_subtree(ti, ett_siii_mdt_dev_control);
@@ -963,13 +963,13 @@ static void dissect_siii_mdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
switch (t_phase) /* call the MDT dissector depending on the current communication phase */
{
case COMMUNICATION_PHASE_0: /* CP0 */
- tvb_n = tvb_new_subset(tvb, 6, 40, 40);
+ tvb_n = tvb_new_subset_length(tvb, 6, 40);
dissect_siii_mdt_cp0(tvb_n, pinfo, subtree);
break;
case COMMUNICATION_PHASE_1: /* CP1 */
case COMMUNICATION_PHASE_2: /* CP2 */
- tvb_n = tvb_new_subset(tvb, 6, 1280, 1280);
+ tvb_n = tvb_new_subset_length(tvb, 6, 1280);
dissect_siii_mdt_cp1_2(tvb_n, pinfo, subtree, telno);
break;
@@ -1095,13 +1095,13 @@ static void dissect_siii_at_cp1_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree
for (idx = 0; idx < SERCOS_SLAVE_GROUP_SIZE; ++idx) /* each AT of CP1/2 has data of 128 different slaves */
{
- tvb_n = tvb_new_subset(tvb, 6 * idx, 6, 6); /* subset for service channel data */
+ tvb_n = tvb_new_subset_length(tvb, 6 * idx, 6); /* subset for service channel data */
ti = proto_tree_add_text(subtree_svc, tvb_n, 0, 6, "Device %u", idx + devstart);
subtree = proto_item_add_subtree(ti, ett_siii_at_svc_channel);
dissect_siii_at_svc(tvb_n, pinfo, subtree, idx + devstart);
- tvb_n = tvb_new_subset(tvb, SERCOS_SLAVE_GROUP_SIZE * 6 + 4 * idx, 2, 2); /* subset for device status information */
+ tvb_n = tvb_new_subset_length(tvb, SERCOS_SLAVE_GROUP_SIZE * 6 + 4 * idx, 2); /* subset for device status information */
ti = proto_tree_add_text(subtree_devstat, tvb_n, 0, 2, "Device %u", idx + devstart);
subtree = proto_item_add_subtree(ti, ett_siii_at_dev_status);
@@ -1155,13 +1155,13 @@ static void dissect_siii_at(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch (phase) /* call the AT dissector depending on the current communication phase */
{
case COMMUNICATION_PHASE_0: /* CP0 */
- tvb_n = tvb_new_subset(tvb, 6, 1024, 1024);
+ tvb_n = tvb_new_subset_length(tvb, 6, 1024);
dissect_siii_at_cp0(tvb_n, pinfo, subtree);
break;
case COMMUNICATION_PHASE_1: /* CP1 */
case COMMUNICATION_PHASE_2: /* CP2 */
- tvb_n = tvb_new_subset(tvb, 6, 1280, 1280);
+ tvb_n = tvb_new_subset_length(tvb, 6, 1280);
dissect_siii_at_cp1_2(tvb_n, pinfo, subtree, telno);
break;
diff --git a/epan/dissectors/packet-ses.c b/epan/dissectors/packet-ses.c
index f052a9a776..2a0814dbe0 100644
--- a/epan/dissectors/packet-ses.c
+++ b/epan/dissectors/packet-ses.c
@@ -339,7 +339,7 @@ call_pres_dissector(tvbuff_t *tvb, int offset, guint16 param_len,
/* Yes - call presentation dissector */
tvbuff_t *next_tvb;
- next_tvb = tvb_new_subset(tvb, offset, param_len, param_len);
+ next_tvb = tvb_new_subset_length(tvb, offset, param_len);
/* Pass the session pdu to the presentation dissector */
call_dissector_with_data(pres_handle, next_tvb, pinfo, tree, session);
}
diff --git a/epan/dissectors/packet-sgsap.c b/epan/dissectors/packet-sgsap.c
index 946413d101..ae516d3c6f 100644
--- a/epan/dissectors/packet-sgsap.c
+++ b/epan/dissectors/packet-sgsap.c
@@ -378,7 +378,7 @@ de_sgsap_nas_msg_container(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
/* Octets 3 to 253 contain the SMS message (i.e. CP DATA, CP ACK or CP ERROR)
* as defined in subclause 7.2 of 3GPP TS 24.011 [10]
*/
- new_tvb = tvb_new_subset(tvb, curr_offset, len, len);
+ new_tvb = tvb_new_subset_length(tvb, curr_offset, len);
if (gsm_a_dtap_handle) {
call_dissector(gsm_a_dtap_handle, new_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-sigcomp.c b/epan/dissectors/packet-sigcomp.c
index 5753eeb119..c6f6156b22 100644
--- a/epan/dissectors/packet-sigcomp.c
+++ b/epan/dissectors/packet-sigcomp.c
@@ -708,7 +708,7 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
}
if ( decompress ) {
- msg_tvb = tvb_new_subset(tvb, offset, msg_len, msg_len);
+ msg_tvb = tvb_new_subset_length(tvb, offset, msg_len);
/*
* buff = Where "state" will be stored
* p_id_start = Partial state identifier start pos in the buffer(buff)
@@ -759,7 +759,7 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
udvm_tvb = tvb_new_child_real_data(tvb, buff,state_length+state_address,state_length+state_address);
add_new_data_source(pinfo, udvm_tvb, "State/ExecutionTrace");
- udvm2_tvb = tvb_new_subset(udvm_tvb, state_address, state_length, state_length);
+ udvm2_tvb = tvb_new_subset_length(udvm_tvb, state_address, state_length);
udvm_exe_item = proto_tree_add_item(sigcomp_tree, hf_udvm_execution_trace,
udvm2_tvb, 0, state_length,
ENC_NA);
@@ -881,7 +881,7 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
" %u (0x%x) bytes", bytecode_len, bytecode_len);
sigcomp_udvm_tree = proto_item_add_subtree( udvm_bytecode_item, ett_sigcomp_udvm);
- udvm_tvb = tvb_new_subset(tvb, offset, len, len);
+ udvm_tvb = tvb_new_subset_length(tvb, offset, len);
if ( dissect_udvm_code )
dissect_udvm_bytecode(udvm_tvb, sigcomp_udvm_tree, destination);
@@ -895,7 +895,7 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
}
if ( decompress ){
- msg_tvb = tvb_new_subset(tvb, offset, msg_len, msg_len);
+ msg_tvb = tvb_new_subset_length(tvb, offset, msg_len);
udvm_exe_item = proto_tree_add_item(sigcomp_tree, hf_udvm_execution_trace,
tvb, bytecode_offset, bytecode_len,
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c
index 9d1c29d9f4..28ab85ed56 100644
--- a/epan/dissectors/packet-sip.c
+++ b/epan/dissectors/packet-sip.c
@@ -2656,7 +2656,7 @@ dissect_sip_common(tvbuff_t *tvb, int offset, int remaining_length, packet_info
ext_hdr_handle = dissector_get_string_handle(ext_hdr_subdissector_table, header_name);
if (ext_hdr_handle != NULL) {
tvbuff_t *next_tvb2;
- next_tvb2 = tvb_new_subset(tvb, value_offset, value_len, value_len);
+ next_tvb2 = tvb_new_subset_length(tvb, value_offset, value_len);
dissector_try_string(ext_hdr_subdissector_table, header_name, next_tvb2, pinfo, proto_item_add_subtree(ti_c, ett_sip_ext_hdr), NULL);
} else {
expert_add_info_format(pinfo, ti_c, &ei_sip_unrecognized_header,
@@ -3817,7 +3817,7 @@ dfilter_sip_status_line(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gin
/* If we have a SIP diagnostics sub dissector call it */
if(sip_diag_handle){
- next_tvb = tvb_new_subset(tvb, offset, diag_len, diag_len);
+ next_tvb = tvb_new_subset_length(tvb, offset, diag_len);
call_dissector(sip_diag_handle, next_tvb, pinfo, tree);
}
}
diff --git a/epan/dissectors/packet-smb-direct.c b/epan/dissectors/packet-smb-direct.c
index 9cd1d064fb..6f107550f1 100644
--- a/epan/dissectors/packet-smb-direct.c
+++ b/epan/dissectors/packet-smb-direct.c
@@ -385,8 +385,8 @@ dissect_smb_direct(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
}
if (data_length <= (guint32)len) {
- next_tvb = tvb_new_subset(tvb, data_offset,
- data_length, data_length);
+ next_tvb = tvb_new_subset_length(tvb, data_offset,
+ data_length);
}
if (next_tvb != NULL) {
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c
index 6698dced0d..d986fc80df 100644
--- a/epan/dissectors/packet-smb.c
+++ b/epan/dissectors/packet-smb.c
@@ -1023,7 +1023,7 @@ feed_eo_smb(guint16 cmd, guint16 fid, tvbuff_t * tvb, packet_info *pinfo, guint1
GSList *GSL_iterator;
/* Create a new tvb to point to the payload data */
- data_tvb = tvb_new_subset(tvb, dataoffset, datalen, datalen);
+ data_tvb = tvb_new_subset_length(tvb, dataoffset, datalen);
/* Create the eo_info to pass to the listener */
eo_info = wmem_new(wmem_packet_scope(), smb_eo_t);
@@ -7488,8 +7488,7 @@ dissect_session_setup_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tre
ett_smb_secblob);
CHECK_BYTE_COUNT(sbloblen);
- blob_tvb = tvb_new_subset(tvb, offset, sbloblen,
- sbloblen);
+ blob_tvb = tvb_new_subset_length(tvb, offset, sbloblen);
if (si && si->ct && si->ct->raw_ntlmssp &&
(tvb_strneql(tvb, offset, "NTLMSSP", 7) == 0)) {
@@ -14057,7 +14056,7 @@ dissect_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (pc>tvb_length_remaining(tvb, po)) {
p_tvb = tvb_new_subset(tvb, po, tvb_length_remaining(tvb, po), pc);
} else {
- p_tvb = tvb_new_subset(tvb, po, pc, pc);
+ p_tvb = tvb_new_subset_length(tvb, po, pc);
}
} else {
p_tvb = NULL;
@@ -14066,7 +14065,7 @@ dissect_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (dc>tvb_length_remaining(tvb, od)) {
d_tvb = tvb_new_subset(tvb, od, tvb_length_remaining(tvb, od), dc);
} else {
- d_tvb = tvb_new_subset(tvb, od, dc, dc);
+ d_tvb = tvb_new_subset_length(tvb, od, dc);
}
} else {
d_tvb = NULL;
@@ -14075,7 +14074,7 @@ dissect_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (sl>tvb_length_remaining(tvb, so)) {
s_tvb = tvb_new_subset(tvb, so, tvb_length_remaining(tvb, so), sl);
} else {
- s_tvb = tvb_new_subset(tvb, so, sl, sl);
+ s_tvb = tvb_new_subset_length(tvb, so, sl);
}
} else {
s_tvb = NULL;
@@ -14126,7 +14125,7 @@ dissect_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* A tvbuff containing the setup words and
* the pipe path.
*/
- sp_tvb = tvb_new_subset(tvb, spo, spc, spc);
+ sp_tvb = tvb_new_subset_length(tvb, spo, spc);
/*
* A tvbuff containing the parameters and the
@@ -14155,7 +14154,7 @@ dissect_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* A tvbuff containing the setup words and
* the mailslot path.
*/
- sp_tvb = tvb_new_subset(tvb, spo, spc, spc);
+ sp_tvb = tvb_new_subset_length(tvb, spo, spc);
dissected_trans = dissect_mailslot_smb(sp_tvb,
s_tvb, d_tvb, an+10, pinfo, top_tree_global, si);
}
@@ -16633,7 +16632,7 @@ dissect_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if ((2*sc) > tvb_length_remaining(tvb, offset)) {
s_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), 2*sc);
} else {
- s_tvb = tvb_new_subset(tvb, offset, 2*sc, 2*sc);
+ s_tvb = tvb_new_subset_length(tvb, offset, 2*sc);
}
sp_tvb = tvb_new_subset_remaining(tvb, offset);
} else {
@@ -16686,10 +16685,10 @@ dissect_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if (pd_tvb) {
/* OK we have reassembled data, extract d_tvb and p_tvb from it */
if (tp) {
- p_tvb = tvb_new_subset(pd_tvb, 0, tp, tp);
+ p_tvb = tvb_new_subset_length(pd_tvb, 0, tp);
}
if (td) {
- d_tvb = tvb_new_subset(pd_tvb, tp, td, td);
+ d_tvb = tvb_new_subset_length(pd_tvb, tp, td);
}
} else {
/* It was not reassembled. Do as best as we can.
diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c
index 7d165088fe..aa4e3dc324 100644
--- a/epan/dissectors/packet-smb2.c
+++ b/epan/dissectors/packet-smb2.c
@@ -738,7 +738,7 @@ feed_eo_smb2(tvbuff_t * tvb,packet_info *pinfo,smb2_info_t * si, guint16 dataoff
gchar **aux_string_v;
/* Create a new tvb to point to the payload data */
- data_tvb = tvb_new_subset(tvb, dataoffset, length, length);
+ data_tvb = tvb_new_subset_length(tvb, dataoffset, length);
/* Create the eo_info to pass to the listener */
eo_info = wmem_new(wmem_packet_scope(), smb_eo_t);
/* Fill in eo_info */
@@ -6745,7 +6745,7 @@ dissect_smb2_transform_header(packet_info *pinfo _U_, proto_tree *tree,
}
done_decryption:
#endif
- *enc_tvb = tvb_new_subset(tvb, offset, sti->size, sti->size);
+ *enc_tvb = tvb_new_subset_length(tvb, offset, sti->size);
if (plain_data != NULL) {
*plain_tvb = tvb_new_child_real_data(*enc_tvb, plain_data, sti->size, sti->size);
diff --git a/epan/dissectors/packet-sndcp-xid.c b/epan/dissectors/packet-sndcp-xid.c
index f994fec59a..6053fe091c 100644
--- a/epan/dissectors/packet-sndcp-xid.c
+++ b/epan/dissectors/packet-sndcp-xid.c
@@ -520,7 +520,7 @@ dissect_sndcp_xid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1, parameter_len);
offset += 2;
- dcomp_tvb = tvb_new_subset(tvb, offset, parameter_len, parameter_len);
+ dcomp_tvb = tvb_new_subset_length(tvb, offset, parameter_len);
parse_compression_parameters(dcomp_tvb, dcomp_tree, TRUE);
offset += parameter_len;
@@ -539,7 +539,7 @@ dissect_sndcp_xid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1, parameter_len);
offset += 2;
- pcomp_tvb = tvb_new_subset(tvb, offset, parameter_len, parameter_len);
+ pcomp_tvb = tvb_new_subset_length(tvb, offset, parameter_len);
parse_compression_parameters(pcomp_tvb, pcomp_tree, FALSE);
offset += parameter_len;
diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c
index 68483ccd10..4706e83e77 100644
--- a/epan/dissectors/packet-snmp.c
+++ b/epan/dissectors/packet-snmp.c
@@ -1128,7 +1128,7 @@ already_added:
pt_value = proto_item_add_subtree(pi_value,ett_value);
if (value_len > 0 && oid_string) {
- tvbuff_t* sub_tvb = tvb_new_subset(tvb, value_offset, value_len, value_len);
+ tvbuff_t* sub_tvb = tvb_new_subset_length(tvb, value_offset, value_len);
next_tvb_add_string(&var_list, sub_tvb, (snmp_var_in_tree) ? pt_value : NULL, value_sub_dissectors_table, oid_string);
}
diff --git a/epan/dissectors/packet-spice.c b/epan/dissectors/packet-spice.c
index efa8f0fd7e..951c2ec500 100644
--- a/epan/dissectors/packet-spice.c
+++ b/epan/dissectors/packet-spice.c
@@ -1118,7 +1118,7 @@ dissect_ImageJPEG_Alpha(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui
ti = proto_tree_add_text(tree, tvb, offset - 9, Data_Size + 9, "RGB JPEG Image, Alpha channel (%u bytes)", Data_Size);
JPEG_tree = proto_item_add_subtree(ti, ett_JPEG);
- jpeg_tvb = tvb_new_subset(tvb, offset, JPEG_Size, JPEG_Size);
+ jpeg_tvb = tvb_new_subset_length(tvb, offset, JPEG_Size);
call_dissector(jpeg_handle, jpeg_tvb, pinfo, JPEG_tree);
offset += JPEG_Size;
@@ -1138,7 +1138,7 @@ dissect_ImageJPEG(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, const gui
ti = proto_tree_add_text(tree, tvb, offset, JPEG_Size + 4, "JPEG Image (%u bytes)", JPEG_Size);
JPEG_tree = proto_item_add_subtree(ti, ett_JPEG);
- jpeg_tvb = tvb_new_subset(tvb, offset + 4, JPEG_Size, JPEG_Size);
+ jpeg_tvb = tvb_new_subset_length(tvb, offset + 4, JPEG_Size);
call_dissector(jpeg_handle, jpeg_tvb, pinfo, JPEG_tree);
return JPEG_Size + 4;
@@ -1951,7 +1951,7 @@ dissect_spice_display_server(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo
proto_tree_add_item(tree, hf_display_stream_data_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset += 4;
proto_tree_add_text(tree, tvb, offset, data_size, "Stream data");
- jpeg_tvb = tvb_new_subset(tvb, offset, data_size, data_size);
+ jpeg_tvb = tvb_new_subset_length(tvb, offset, data_size);
call_dissector(jpeg_handle, jpeg_tvb, pinfo, tree);
offset += data_size;
break;
diff --git a/epan/dissectors/packet-spnego.c b/epan/dissectors/packet-spnego.c
index adcd55b5d0..469adf8e72 100644
--- a/epan/dissectors/packet-spnego.c
+++ b/epan/dissectors/packet-spnego.c
@@ -1280,8 +1280,8 @@ dissect_spnego_krb5_wrap_base(tvbuff_t *tvb, int offset, packet_info *pinfo
*/
return offset;
}
- pinfo->gssapi_encrypted_tvb = tvb_new_subset(
- tvb, offset, len, len);
+ pinfo->gssapi_encrypted_tvb = tvb_new_subset_length(
+ tvb, offset, len);
}
/* if this is KRB5 wrapped rc4-hmac */
@@ -1292,9 +1292,8 @@ dissect_spnego_krb5_wrap_base(tvbuff_t *tvb, int offset, packet_info *pinfo
as well ?
*/
if(!pinfo->gssapi_wrap_tvb){
- pinfo->gssapi_wrap_tvb = tvb_new_subset(
+ pinfo->gssapi_wrap_tvb = tvb_new_subset_length(
tvb, start_offset-2,
- GSS_ARCFOUR_WRAP_TOKEN_SIZE,
GSS_ARCFOUR_WRAP_TOKEN_SIZE);
}
#if defined(HAVE_HEIMDAL_KERBEROS) || defined(HAVE_MIT_KERBEROS)
@@ -1497,8 +1496,8 @@ dissect_spnego_krb5_cfx_wrap_base(tvbuff_t *tvb, int offset, packet_info *pinfo
inner_token_len = tvb_reported_length_remaining(tvb, offset) -
ec;
- pinfo->gssapi_wrap_tvb = tvb_new_subset(tvb, offset,
- inner_token_len, inner_token_len);
+ pinfo->gssapi_wrap_tvb = tvb_new_subset_length(tvb, offset,
+ inner_token_len);
offset += inner_token_len;
@@ -1535,9 +1534,8 @@ dissect_spnego_krb5_cfx_wrap_base(tvbuff_t *tvb, int offset, packet_info *pinfo
as well ?
*/
if(!pinfo->gssapi_wrap_tvb){
- pinfo->gssapi_wrap_tvb = tvb_new_subset(
+ pinfo->gssapi_wrap_tvb = tvb_new_subset_length(
tvb, start_offset-2,
- offset - (start_offset-2),
offset - (start_offset-2));
}
}
@@ -1545,7 +1543,7 @@ dissect_spnego_krb5_cfx_wrap_base(tvbuff_t *tvb, int offset, packet_info *pinfo
#if defined(HAVE_HEIMDAL_KERBEROS) || defined(HAVE_MIT_KERBEROS)
{
- tvbuff_t *checksum_tvb = tvb_new_subset(tvb, 16, checksum_size, checksum_size);
+ tvbuff_t *checksum_tvb = tvb_new_subset_length(tvb, 16, checksum_size);
if (pinfo->gssapi_data_encrypted) {
if(pinfo->gssapi_encrypted_tvb){
@@ -1954,7 +1952,7 @@ void proto_register_spnego(void) {
NULL, HFILL }},
/*--- End of included file: packet-spnego-hfarr.c ---*/
-#line 1409 "../../asn1/spnego/packet-spnego-template.c"
+#line 1407 "../../asn1/spnego/packet-spnego-template.c"
};
/* List of subtrees */
@@ -1977,7 +1975,7 @@ void proto_register_spnego(void) {
&ett_spnego_InitialContextToken_U,
/*--- End of included file: packet-spnego-ettarr.c ---*/
-#line 1419 "../../asn1/spnego/packet-spnego-template.c"
+#line 1417 "../../asn1/spnego/packet-spnego-template.c"
};
/* Register protocol */
diff --git a/epan/dissectors/packet-srp.c b/epan/dissectors/packet-srp.c
index 65f2fad8e9..7a5d1bd0e2 100644
--- a/epan/dissectors/packet-srp.c
+++ b/epan/dissectors/packet-srp.c
@@ -106,7 +106,7 @@ static void dissect_srp_command(tvbuff_t * tvb, packet_info * pinfo, proto_tree
proto_tree_add_item(srp_tree,hf_srp_seqno,tvb,1,1,ENC_BIG_ENDIAN);
payload_len = tvb_reported_length_remaining(tvb,4);
- next_tvb = tvb_new_subset(tvb, 2, payload_len, payload_len );
+ next_tvb = tvb_new_subset_length(tvb, 2, payload_len);
/* XXX currently, we always dissect as CCSRL. It's only that in
* H324/Annex C though.
diff --git a/epan/dissectors/packet-sscop.c b/epan/dissectors/packet-sscop.c
index d89fc23f7e..c598c080ac 100644
--- a/epan/dissectors/packet-sscop.c
+++ b/epan/dissectors/packet-sscop.c
@@ -323,7 +323,7 @@ dissect_sscop_and_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, d
* Therefore, we know that the captured length of the payload is
* equal to the length of the payload.
*/
- next_tvb = tvb_new_subset(tvb, 0, reported_length, reported_length);
+ next_tvb = tvb_new_subset_length(tvb, 0, reported_length);
if (sscop_info.type == SSCOP_SD)
{
call_dissector(payload_handle, next_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-stun.c b/epan/dissectors/packet-stun.c
index 456332c199..457936d512 100644
--- a/epan/dissectors/packet-stun.c
+++ b/epan/dissectors/packet-stun.c
@@ -1039,7 +1039,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
proto_tree_add_uint(att_tree, hf_stun_att_padding, tvb, offset+att_length, pad, pad);
}
- next_tvb = tvb_new_subset(tvb, offset, att_length, att_length);
+ next_tvb = tvb_new_subset_length(tvb, offset, att_length);
if (!dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, att_tree, &hdtbl_entry, NULL)) {
call_dissector_only(data_handle, next_tvb, pinfo, att_tree, NULL);
diff --git a/epan/dissectors/packet-sua.c b/epan/dissectors/packet-sua.c
index 155d5c064e..257f253035 100644
--- a/epan/dissectors/packet-sua.c
+++ b/epan/dissectors/packet-sua.c
@@ -592,7 +592,7 @@ dissect_info_string_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto
info_string_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
/* If we have a SUA Info String sub dissector call it */
if(sua_info_str_handle) {
- next_tvb = tvb_new_subset(parameter_tvb, INFO_STRING_OFFSET, info_string_length, info_string_length);
+ next_tvb = tvb_new_subset_length(parameter_tvb, INFO_STRING_OFFSET, info_string_length);
call_dissector(sua_info_str_handle, next_tvb, pinfo, parameter_tree);
return;
}
@@ -1159,7 +1159,7 @@ dissect_data_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, prot
if(data_tvb)
{
- *data_tvb = tvb_new_subset(parameter_tvb, PARAMETER_VALUE_OFFSET, data_length, data_length);
+ *data_tvb = tvb_new_subset_length(parameter_tvb, PARAMETER_VALUE_OFFSET, data_length);
}
}
@@ -2136,7 +2136,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, packet_info *pinfo, proto_tree *tre
if (remaining_length >= length)
total_length = MIN(total_length, remaining_length);
/* create a tvb for the parameter including the padding bytes */
- parameter_tvb = tvb_new_subset(parameters_tvb, offset, total_length, total_length);
+ parameter_tvb = tvb_new_subset_length(parameters_tvb, offset, total_length);
switch(version) {
case SUA_V08:
dissect_v8_parameter(parameter_tvb, pinfo, tree, data_tvb, source_ssn, dest_ssn);
@@ -2183,7 +2183,7 @@ dissect_sua_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *sua_t
sua_source_gt = NULL;
sua_destination_gt = NULL;
- common_header_tvb = tvb_new_subset(message_tvb, COMMON_HEADER_OFFSET, COMMON_HEADER_LENGTH, COMMON_HEADER_LENGTH);
+ common_header_tvb = tvb_new_subset_length(message_tvb, COMMON_HEADER_OFFSET, COMMON_HEADER_LENGTH);
dissect_common_header(common_header_tvb, pinfo, sua_tree);
parameters_tvb = tvb_new_subset_remaining(message_tvb, COMMON_HEADER_LENGTH);
diff --git a/epan/dissectors/packet-tacacs.c b/epan/dissectors/packet-tacacs.c
index 2ea2c8105b..e663c72997 100644
--- a/epan/dissectors/packet-tacacs.c
+++ b/epan/dissectors/packet-tacacs.c
@@ -957,7 +957,7 @@ dissect_tacplus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
((flags&FLAGS_UNENCRYPTED)?"":"Encrypted "), request?"Request":"Reply" );
if( flags&FLAGS_UNENCRYPTED ) {
- new_tvb = tvb_new_subset( tvb, TAC_PLUS_HDR_SIZE, len, len );
+ new_tvb = tvb_new_subset_length( tvb, TAC_PLUS_HDR_SIZE, len );
} else {
new_tvb=NULL;
if( key && *key ){
diff --git a/epan/dissectors/packet-tcap.c b/epan/dissectors/packet-tcap.c
index edcbedff16..38d2b0457c 100644
--- a/epan/dissectors/packet-tcap.c
+++ b/epan/dissectors/packet-tcap.c
@@ -679,7 +679,7 @@ gint ind_field;
comp_offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &ber_class, &pc, &tag);
comp_offset = dissect_ber_length(actx->pinfo, tree, tvb, comp_offset, &len, &ind_field);
/* we can believe the length now */
-next_tvb = tvb_new_subset(tvb, offset, len+comp_offset-offset, len+comp_offset-offset);
+next_tvb = tvb_new_subset_length(tvb, offset, len+comp_offset-offset);
if (!next_tvb)
return comp_offset;
@@ -3878,8 +3878,7 @@ dissect_tcap_param(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset
if (len-(2*ind_field)) /*should always be positive unless we get an empty contructor pointless? */
{
- next_tvb = tvb_new_subset(tvb, offset, len-(2*ind_field),
- len-(2*ind_field));
+ next_tvb = tvb_new_subset_length(tvb, offset, len-(2*ind_field));
dissect_tcap_param(actx, subtree,next_tvb,0);
}
@@ -3904,7 +3903,7 @@ dissect_tcap_param(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset
if (len) /* check for NULLS */
{
- next_tvb = tvb_new_subset(tvb, offset, len, len);
+ next_tvb = tvb_new_subset_length(tvb, offset, len);
dissect_ber_octet_string(TRUE, actx, tree, next_tvb, 0,
hf_tcap_data, NULL);
}
diff --git a/epan/dissectors/packet-telnet.c b/epan/dissectors/packet-telnet.c
index 1c9f97e04b..77a5cf5242 100644
--- a/epan/dissectors/packet-telnet.c
+++ b/epan/dissectors/packet-telnet.c
@@ -1815,10 +1815,10 @@ dissect_telnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
data_len = iac_offset - offset;
if (data_len > 0) {
if (is_tn3270) {
- next_tvb = tvb_new_subset(tvb, offset, data_len, data_len);
+ next_tvb = tvb_new_subset_length(tvb, offset, data_len);
call_dissector(tn3270_handle, next_tvb, pinfo, telnet_tree);
} else if (is_tn5250) {
- next_tvb = tvb_new_subset(tvb, offset, data_len, data_len);
+ next_tvb = tvb_new_subset_length(tvb, offset, data_len);
call_dissector(tn5250_handle, next_tvb, pinfo, telnet_tree);
} else
telnet_add_text(telnet_tree, tvb, offset, data_len);
diff --git a/epan/dissectors/packet-tetra.c b/epan/dissectors/packet-tetra.c
index 9080c42764..c576307a0a 100644
--- a/epan/dissectors/packet-tetra.c
+++ b/epan/dissectors/packet-tetra.c
@@ -9052,7 +9052,7 @@ static void dissect_tetra_UNITDATA_IND(tvbuff_t *tvb, packet_info *pinfo, proto_
if ((remaining_bits)!=0)
byte_len++;
- payload_tvb = tvb_new_subset(tvb, pdu_offset, byte_len, byte_len);
+ payload_tvb = tvb_new_subset_length(tvb, pdu_offset, byte_len);
tetra_dissect_pdu(channel_type, TETRA_UPLINK, payload_tvb, tetra_header_tree, pinfo);
if ((remaining_bits)!=0)
@@ -9108,7 +9108,7 @@ static void dissect_tetra_UNITDATA_REQ(tvbuff_t *tvb, packet_info *pinfo, proto_
if ((remaining_bits)!=0)
byte_len++;
- payload_tvb = tvb_new_subset(tvb, pdu_offset, byte_len, byte_len);
+ payload_tvb = tvb_new_subset_length(tvb, pdu_offset, byte_len);
tetra_dissect_pdu(channel_type, TETRA_DOWNLINK, payload_tvb, tetra_header_tree, pinfo);
pdu_offset += byte_len;
}
diff --git a/epan/dissectors/packet-tipc.c b/epan/dissectors/packet-tipc.c
index a900dc635c..d542823532 100644
--- a/epan/dissectors/packet-tipc.c
+++ b/epan/dissectors/packet-tipc.c
@@ -959,7 +959,7 @@ dissect_tipc_v2_internal_msg(tvbuff_t *tipc_tvb, proto_tree *tipc_tree, packet_i
proto_tree_add_text(top_tree, tipc_tvb, offset, msg_in_bundle_size, "Message %u of %u in Bundle (%s)",
msg_no, message_count, val_to_str_const(msg_in_bundle_user, tipcv2_user_short_str_vals, "unknown"));
- data_tvb = tvb_new_subset(tipc_tvb, offset, msg_in_bundle_size, msg_in_bundle_size);
+ data_tvb = tvb_new_subset_length(tipc_tvb, offset, msg_in_bundle_size);
/* the info column shall not be deleted by the
* encapsulated messages */
@@ -1990,7 +1990,7 @@ dissect_tipc_int_prot_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tipc_tr
msg_no++;
msg_in_bundle_size = tvb_get_ntohl(tvb, offset);
proto_tree_add_text(tipc_tree, tvb, offset, msg_in_bundle_size, "%u Message in Bundle", msg_no);
- data_tvb = tvb_new_subset(tvb, offset, msg_in_bundle_size, msg_in_bundle_size);
+ data_tvb = tvb_new_subset_length(tvb, offset, msg_in_bundle_size);
col_set_fence(pinfo->cinfo, COL_INFO);
dissect_tipc(data_tvb, pinfo, tipc_tree, NULL);
offset = offset + msg_in_bundle_size;
@@ -2052,7 +2052,7 @@ dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
if ((guint32)tvb_length_remaining(tvb, offset) < msg_size) {
tipc_tvb = tvb;
} else {
- tipc_tvb = tvb_new_subset(tvb, offset, msg_size, msg_size);
+ tipc_tvb = tvb_new_subset_length(tvb, offset, msg_size);
}
/* user == 7 only works for v2, this will decode the legacy TIPC configuration protocol */
if (user == TIPCv2_LINK_PROTOCOL) version = TIPCv2;
diff --git a/epan/dissectors/packet-tnef.c b/epan/dissectors/packet-tnef.c
index e88a83ffc1..37a0ffa45f 100644
--- a/epan/dissectors/packet-tnef.c
+++ b/epan/dissectors/packet-tnef.c
@@ -570,7 +570,7 @@ static void dissect_tnef(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
item = proto_tree_add_item(attr_tree, hf_tnef_mapi_props, tvb, offset, length, ENC_NA);
props_tree = proto_item_add_subtree(item, ett_tnef_mapi_props);
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
dissect_mapiprops(next_tvb, pinfo, props_tree);
@@ -592,7 +592,7 @@ static void dissect_tnef(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
item = proto_tree_add_item(attr_tree, hf_tnef_attribute_date, tvb, offset, length, ENC_NA);
date_tree = proto_item_add_subtree(item, ett_tnef_attribute_date);
- next_tvb = tvb_new_subset(tvb, offset, length, length);
+ next_tvb = tvb_new_subset_length(tvb, offset, length);
dissect_DTR(next_tvb, pinfo, date_tree);
diff --git a/epan/dissectors/packet-ua.c b/epan/dissectors/packet-ua.c
index ec48a7f2d6..1bfbbaa324 100644
--- a/epan/dissectors/packet-ua.c
+++ b/epan/dissectors/packet-ua.c
@@ -65,7 +65,7 @@ static void uadecode(e_ua_direction direction,
case 0x16:
{
call_dissector(noe_handle,
- tvb_new_subset(tvb, offset, length, length),
+ tvb_new_subset_length(tvb, offset, length),
pinfo,
tree);
break;
@@ -141,7 +141,7 @@ static void uadecode(e_ua_direction direction,
case 0x50: /* Only UA NOE */
{
call_dissector_with_data(ua3g_handle,
- tvb_new_subset(tvb, offset, length, length),
+ tvb_new_subset_length(tvb, offset, length),
pinfo,
tree, &direction);
break;
diff --git a/epan/dissectors/packet-uasip.c b/epan/dissectors/packet-uasip.c
index 2ac61afe0f..5f82654a1d 100644
--- a/epan/dissectors/packet-uasip.c
+++ b/epan/dissectors/packet-uasip.c
@@ -218,11 +218,11 @@ static void _dissect_uasip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
if (direction == SYS_TO_TERM)
{
- call_dissector(ua_sys_to_term_handle, tvb_new_subset(tvb, offset, datalen, datalen), pinfo, tree);
+ call_dissector(ua_sys_to_term_handle, tvb_new_subset_length(tvb, offset, datalen), pinfo, tree);
}
else if (direction == TERM_TO_SYS)
{
- call_dissector(ua_term_to_sys_handle, tvb_new_subset(tvb, offset, datalen, datalen), pinfo, tree);
+ call_dissector(ua_term_to_sys_handle, tvb_new_subset_length(tvb, offset, datalen), pinfo, tree);
}
else
{
diff --git a/epan/dissectors/packet-uaudp.c b/epan/dissectors/packet-uaudp.c
index 6c947b3a85..60bc292200 100644
--- a/epan/dissectors/packet-uaudp.c
+++ b/epan/dissectors/packet-uaudp.c
@@ -298,12 +298,12 @@ static void _dissect_uaudp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
if (direction == SYS_TO_TERM)
call_dissector(ua_sys_to_term_handle,
- tvb_new_subset(tvb, offset, datalen, datalen),
+ tvb_new_subset_length(tvb, offset, datalen),
pinfo,
tree);
else if (direction == TERM_TO_SYS)
call_dissector(ua_term_to_sys_handle,
- tvb_new_subset(tvb, offset, datalen, datalen),
+ tvb_new_subset_length(tvb, offset, datalen),
pinfo,
tree);
else {
diff --git a/epan/dissectors/packet-ucp.c b/epan/dissectors/packet-ucp.c
index 1eb8ca01d0..017aa0cacf 100644
--- a/epan/dissectors/packet-ucp.c
+++ b/epan/dissectors/packet-ucp.c
@@ -1683,7 +1683,7 @@ add_5xO(proto_tree *tree, tvbuff_t *tvb)
proto_tree *subtree;
ti = proto_tree_add_item(tree, hf_ucp_parm_XSer, tvb, offset, len, ENC_NA);
- tmptvb = tvb_new_subset(tvb, offset, len + 1, len + 1);
+ tmptvb = tvb_new_subset_length(tvb, offset, len + 1);
subtree = proto_item_add_subtree(ti, ett_XSer);
ucp_handle_XSer(subtree, tmptvb);
}
diff --git a/epan/dissectors/packet-uma.c b/epan/dissectors/packet-uma.c
index 0e8f527b01..1cc213b57a 100644
--- a/epan/dissectors/packet-uma.c
+++ b/epan/dissectors/packet-uma.c
@@ -954,7 +954,7 @@ dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
* The Location Estimate field is composed of 1 or more octets with an internal structure
* according to section 7 in [23.032].
*/
- new_tvb = tvb_new_subset(tvb, ie_offset,ie_len, ie_len );
+ new_tvb = tvb_new_subset_length(tvb, ie_offset, ie_len );
dissect_geographical_description(new_tvb, pinfo, urr_ie_tree);
break;
case 9:
@@ -1071,7 +1071,7 @@ dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
*/
proto_tree_add_item(urr_ie_tree, hf_uma_urr_L3_protocol_discriminator, tvb, ie_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(urr_ie_tree, hf_uma_urr_L3_Message, tvb, ie_offset, ie_len, ENC_NA);
- l3_tvb = tvb_new_subset(tvb, ie_offset,ie_len, ie_len );
+ l3_tvb = tvb_new_subset_length(tvb, ie_offset, ie_len );
if (!dissector_try_uint(bssap_pdu_type_table,BSSAP_PDU_TYPE_DTAP, l3_tvb, pinfo, urr_ie_tree))
call_dissector(data_handle, l3_tvb, pinfo, urr_ie_tree);
break;
@@ -1115,7 +1115,7 @@ dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
proto_tree_add_item(urr_ie_tree, hf_uma_urr_L3_protocol_discriminator, tvb, ie_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(urr_ie_tree, hf_uma_urr_L3_Message, tvb, ie_offset, ie_len, ENC_NA);
/* XXX the dissector to call should depend on the RAT type ??? */
- l3_tvb = tvb_new_subset(tvb, ie_offset,ie_len, ie_len );
+ l3_tvb = tvb_new_subset_length(tvb, ie_offset, ie_len );
if (!dissector_try_uint(bssap_pdu_type_table,BSSAP_PDU_TYPE_DTAP, l3_tvb, pinfo, urr_ie_tree))
call_dissector(data_handle, l3_tvb, pinfo, urr_ie_tree);
break;
@@ -1243,7 +1243,7 @@ dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
* The rest of the IE is coded as in [TS 48.018], not including IEI and length, if present
*/
proto_tree_add_item(urr_ie_tree, hf_uma_urr_LLC_PDU, tvb, ie_offset, ie_len, ENC_NA);
- llc_tvb = tvb_new_subset(tvb, ie_offset,ie_len, ie_len );
+ llc_tvb = tvb_new_subset_length(tvb, ie_offset, ie_len );
if (llc_handle) {
col_append_str(pinfo->cinfo, COL_PROTOCOL, "/");
col_set_fence(pinfo->cinfo, COL_PROTOCOL);
@@ -1307,7 +1307,7 @@ dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
* The rest of the IE is the INTER RAT HANDOVER INFO coded as in
* [TS 25.331], not including IEI and length, if present
*/
- new_tvb = tvb_new_subset(tvb, ie_offset,ie_len, ie_len );
+ new_tvb = tvb_new_subset_length(tvb, ie_offset, ie_len );
dissect_rrc_InterRATHandoverInfo_PDU(new_tvb, pinfo, urr_ie_tree, NULL);
break;
case 65:
diff --git a/epan/dissectors/packet-umts_fp.c b/epan/dissectors/packet-umts_fp.c
index c622479f79..49b41a06b6 100644
--- a/epan/dissectors/packet-umts_fp.c
+++ b/epan/dissectors/packet-umts_fp.c
@@ -660,7 +660,7 @@ static gboolean verify_header_crc_edch(tvbuff_t * tvb, packet_info * pinfo, prot
guint16 crc = 0;
guint8 * data = NULL;
/* First create new subset of header with first byte removed. */
- tvbuff_t * headtvb = tvb_new_subset(tvb, 1, header_length-1, header_length-1);
+ tvbuff_t * headtvb = tvb_new_subset_length(tvb, 1, header_length-1);
/* Get data of header with first byte removed. */
data = (guint8 *)tvb_memdup(wmem_packet_scope(), headtvb, 0, header_length-1);
/* Remove first 4 bits of the remaining data which are Header CRC cont. */
@@ -3701,7 +3701,7 @@ void dissect_hsdsch_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto
/* In the very few test cases I've seen, this seems to be
* BCCH with transparent MAC layer. Therefore skip right to
* rlc_bcch and hope for the best. */
- next_tvb = tvb_new_subset(tvb, offset, (gint)pdu_length[n], (gint)pdu_length[n]);
+ next_tvb = tvb_new_subset_length(tvb, offset, (gint)pdu_length[n]);
call_dissector(rlc_bcch_handle, next_tvb, pinfo, top_level_tree);
offset += (gint)pdu_length[n];
} else { /* Else go for CCCH UM, this seems to work. */
@@ -3724,7 +3724,7 @@ void dissect_hsdsch_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto
rlcinf->rbid[j] = (guint8)lchid[n]+1;
rlcinf->urnti[j] = p_fp_info->channel; /*We need to fake urnti*/
- next_tvb = tvb_new_subset(tvb, offset, (gint)pdu_length[n], (gint)pdu_length[n]);
+ next_tvb = tvb_new_subset_length(tvb, offset, (gint)pdu_length[n]);
call_dissector(mac_fdd_hsdsch_handle, next_tvb, pinfo, top_level_tree);
diff --git a/epan/dissectors/packet-usb-ccid.c b/epan/dissectors/packet-usb-ccid.c
index e50b5a66fb..1d4de957fe 100644
--- a/epan/dissectors/packet-usb-ccid.c
+++ b/epan/dissectors/packet-usb-ccid.c
@@ -479,7 +479,7 @@ dissect_ccid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
next_tvb = tvb_new_subset_remaining(tvb, 10);
if (sub_selected == SUB_PN532) {
- next_tvb= tvb_new_subset(tvb, 10, tvb_get_guint8(tvb, 1), tvb_get_guint8(tvb, 1));
+ next_tvb= tvb_new_subset_length(tvb, 10, tvb_get_guint8(tvb, 1));
call_dissector_with_data(sub_handles[SUB_PN532], next_tvb, pinfo, tree, usb_conv_info);
} else if (sub_selected == SUB_ACR122_PN532) {
pinfo->p2p_dir = P2P_DIR_RECV;
diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c
index f34352f4f5..a94120c479 100644
--- a/epan/dissectors/packet-usb.c
+++ b/epan/dissectors/packet-usb.c
@@ -1907,7 +1907,7 @@ dissect_usb_configuration_descriptor(packet_info *pinfo _U_, proto_tree *parent_
offset = dissect_usb_interface_assn_descriptor(pinfo, parent_tree, tvb, offset, usb_trans_info, usb_conv_info);
break;
default:
- next_tvb = tvb_new_subset(tvb, offset, next_len, next_len);
+ next_tvb = tvb_new_subset_length(tvb, offset, next_len);
if (dissector_try_uint_new(usb_descriptor_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, parent_tree, TRUE, usb_conv_info)) {
offset += next_len;
} else {
@@ -3036,7 +3036,7 @@ dissect_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
(header_info & (USB_HEADER_IS_LINUX | USB_HEADER_IS_64_BYTES))) {
setup_tvb = tvb_new_composite();
- next_tvb = tvb_new_subset(tvb, offset - 7, 7, 7);
+ next_tvb = tvb_new_subset_length(tvb, offset - 7, 7);
tvb_composite_append(setup_tvb, next_tvb);
}
diff --git a/epan/dissectors/packet-user_encap.c b/epan/dissectors/packet-user_encap.c
index a62ef83373..72f71e67fc 100644
--- a/epan/dissectors/packet-user_encap.c
+++ b/epan/dissectors/packet-user_encap.c
@@ -137,7 +137,7 @@ static void dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
proto_item_set_text(item,"DLT: %d",pinfo->match_uint + 147 - WTAP_ENCAP_USER0);
if (encap->header_size) {
- tvbuff_t* hdr_tvb = tvb_new_subset(tvb, 0, encap->header_size, encap->header_size);
+ tvbuff_t* hdr_tvb = tvb_new_subset_length(tvb, 0, encap->header_size);
call_dissector(encap->header_proto, hdr_tvb, pinfo, tree);
if (encap->header_proto_name) {
const char *proto_name = dissector_handle_get_long_name(find_dissector(encap->header_proto_name));
@@ -160,7 +160,7 @@ static void dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
}
if (encap->trailer_size) {
- tvbuff_t* trailer_tvb = tvb_new_subset(tvb, encap->header_size + len, encap->trailer_size, encap->trailer_size);
+ tvbuff_t* trailer_tvb = tvb_new_subset_length(tvb, encap->header_size + len, encap->trailer_size);
call_dissector(encap->trailer_proto, trailer_tvb, pinfo, tree);
if (encap->trailer_proto_name) {
const char *proto_name = dissector_handle_get_long_name(find_dissector(encap->trailer_proto_name));
diff --git a/epan/dissectors/packet-v52.c b/epan/dissectors/packet-v52.c
index 3a01e24668..e8d9f926cf 100644
--- a/epan/dissectors/packet-v52.c
+++ b/epan/dissectors/packet-v52.c
@@ -694,7 +694,7 @@ dissect_pstn_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -728,7 +728,7 @@ dissect_cadenced_ring(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -765,7 +765,7 @@ dissect_pulsed_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -812,7 +812,7 @@ dissect_steady_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -849,7 +849,7 @@ dissect_digit_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -894,7 +894,7 @@ dissect_recognition_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -937,7 +937,7 @@ dissect_enable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -993,7 +993,7 @@ dissect_disable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1032,7 +1032,7 @@ dissect_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1072,7 +1072,7 @@ dissect_resource_unavailable(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1105,7 +1105,7 @@ dissect_pulse_notification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
info_element = tvb_get_guint8(tvb, offset);
data_length = 1;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1136,7 +1136,7 @@ dissect_line_information(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in
info_element = tvb_get_guint8(tvb, offset);
data_length = 1;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1167,7 +1167,7 @@ dissect_state(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
info_element = tvb_get_guint8(tvb, offset);
data_length = 1;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1198,7 +1198,7 @@ dissect_auto_sig_sequence(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
info_element = tvb_get_guint8(tvb, offset);
data_length = 1;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1229,7 +1229,7 @@ dissect_sequence_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
info_element = tvb_get_guint8(tvb, offset);
data_length = 1;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1260,7 +1260,7 @@ dissect_control_function_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1296,7 +1296,7 @@ dissect_control_function_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1333,7 +1333,7 @@ dissect_variant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1367,7 +1367,7 @@ dissect_interface_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1404,7 +1404,7 @@ dissect_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1444,7 +1444,7 @@ dissect_physical_c_channel_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1480,7 +1480,7 @@ dissect_pp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1513,7 +1513,7 @@ dissect_protocol_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1549,7 +1549,7 @@ dissect_performance_grading(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
info_element = tvb_get_guint8(tvb, offset);
data_length = 1;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1581,7 +1581,7 @@ dissect_cp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
info_element = tvb_get_guint8(tvb, offset);
data_length = 1;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1615,7 +1615,7 @@ dissect_user_port_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1664,7 +1664,7 @@ dissect_isdn_port_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, pr
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1700,7 +1700,7 @@ dissect_v5_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tre
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1745,7 +1745,7 @@ dissect_multi_slot_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1794,7 +1794,7 @@ dissect_bcc_rejct_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1827,7 +1827,7 @@ dissect_bcc_protocol_error_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1865,7 +1865,7 @@ dissect_connection_incomplete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
@@ -1905,7 +1905,7 @@ dissect_link_control_function(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
info_element = tvb_get_guint8(tvb, offset);
data_length = tvb_get_guint8(tvb, offset+1)+2;
- info_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
+ info_tvb = tvb_new_subset_length(tvb, offset, data_length);
if (tree) {
ti_info = proto_tree_add_text(tree, info_tvb, info_offset, -1, "Info Element:");
diff --git a/epan/dissectors/packet-v5ua.c b/epan/dissectors/packet-v5ua.c
index 2e6224fb68..cc412805e0 100644
--- a/epan/dissectors/packet-v5ua.c
+++ b/epan/dissectors/packet-v5ua.c
@@ -643,7 +643,7 @@ dissect_layer3_message(tvbuff_t *layer3_data_tvb, proto_tree *v5ua_tree,proto_it
tvbuff_t *protocol_data_tvb;
protocol_data_length = tvb_get_ntohs(layer3_data_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
- protocol_data_tvb = tvb_new_subset(layer3_data_tvb, PARAMETER_VALUE_OFFSET, protocol_data_length, protocol_data_length);
+ protocol_data_tvb = tvb_new_subset_length(layer3_data_tvb, PARAMETER_VALUE_OFFSET, protocol_data_length);
call_dissector(v52_handle, protocol_data_tvb, pinfo, v5ua_tree);
@@ -655,7 +655,7 @@ dissect_layer3_message(tvbuff_t *layer3_data_tvb, proto_tree *v5ua_tree,proto_it
tvbuff_t *protocol_data_tvb;
protocol_data_length = tvb_get_ntohs(layer3_data_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
- protocol_data_tvb = tvb_new_subset(layer3_data_tvb, PARAMETER_VALUE_OFFSET, protocol_data_length, protocol_data_length);
+ protocol_data_tvb = tvb_new_subset_length(layer3_data_tvb, PARAMETER_VALUE_OFFSET, protocol_data_length);
call_dissector(q931_handle, protocol_data_tvb, pinfo, v5ua_tree);
proto_item_append_text(parameter_item, " (%u byte%s)", protocol_data_length, plurality(protocol_data_length, "", "s"));
@@ -947,7 +947,7 @@ dissect_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *v5ua_
length_2 = msg_length - offset;
if(length_2 > 0){
if(tvb_get_guint8(parameter_tvb, offset) == 0x48){
- layer3_data_tvb = tvb_new_subset(parameter_tvb, offset, length_2, length_2);
+ layer3_data_tvb = tvb_new_subset_length(parameter_tvb, offset, length_2);
dissect_layer3_message(layer3_data_tvb, v5ua_tree, parameter_item, pinfo);
}
}
@@ -1046,7 +1046,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, packet_info *pinfo, proto_tree *tre
if (remaining_length >= length)
total_length = MIN(total_length, remaining_length);
/* create a tvb for the parameter including the padding bytes */
- parameter_tvb = tvb_new_subset(parameters_tvb, offset, total_length, total_length);
+ parameter_tvb = tvb_new_subset_length(parameters_tvb, offset, total_length);
dissect_parameter(parameter_tvb, pinfo, v5ua_tree);
/* get rid of the handled parameter */
offset += total_length;
@@ -1351,7 +1351,7 @@ dissect_v5ua_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_
{
tvbuff_t *common_header_tvb, *parameters_tvb;
- common_header_tvb = tvb_new_subset(tvb, COMMON_HEADER_OFFSET, COMMON_HEADER_LENGTH, COMMON_HEADER_LENGTH);
+ common_header_tvb = tvb_new_subset_length(tvb, COMMON_HEADER_OFFSET, COMMON_HEADER_LENGTH);
dissect_common_header(common_header_tvb, pinfo, v5ua_tree);
parameters_tvb = tvb_new_subset_remaining(tvb, COMMON_HEADER_LENGTH);
diff --git a/epan/dissectors/packet-wassp.c b/epan/dissectors/packet-wassp.c
index a822c5320d..aa0b7e8d76 100644
--- a/epan/dissectors/packet-wassp.c
+++ b/epan/dissectors/packet-wassp.c
@@ -778,7 +778,7 @@ dissect_snmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *wassp_tree,
/* Don't add SNMP stuff to the info column */
col_set_writable(pinfo->cinfo, FALSE);
- snmp_tvb = tvb_new_subset(tvb, offset, length, length);
+ snmp_tvb = tvb_new_subset_length(tvb, offset, length);
/* Continue after SNMP dissection errors */
TRY {
@@ -803,7 +803,7 @@ dissect_ieee80211(tvbuff_t *tvb, packet_info *pinfo, proto_tree *wassp_tree,
/* Don't add IEEE 802.11 stuff to the info column */
col_set_writable(pinfo->cinfo, FALSE);
- ieee80211_tvb = tvb_new_subset(tvb, offset, length, length);
+ ieee80211_tvb = tvb_new_subset_length(tvb, offset, length);
/* Continue after IEEE 802.11 dissection errors */
TRY {
diff --git a/epan/dissectors/packet-winsrepl.c b/epan/dissectors/packet-winsrepl.c
index 44147f8c37..b351f69996 100644
--- a/epan/dissectors/packet-winsrepl.c
+++ b/epan/dissectors/packet-winsrepl.c
@@ -425,7 +425,7 @@ dissect_winsrepl_wins_name(tvbuff_t *winsrepl_tvb, packet_info *pinfo,
* the type is 0x1b. I think I've seen this in at least
* one capture.
*/
- name_tvb = tvb_new_subset(winsrepl_tvb, winsrepl_offset, name_len, name_len);
+ name_tvb = tvb_new_subset_length(winsrepl_tvb, winsrepl_offset, name_len);
netbios_add_name("Name", name_tvb, 0, name_tree);
name_type = get_netbios_name(name_tvb, 0, name_str, (NETBIOS_NAME_LEN - 1)*4 + 1);
proto_item_append_text(name_item, ": %s<%02x>", name_str, name_type);
diff --git a/epan/dissectors/packet-wsp.c b/epan/dissectors/packet-wsp.c
index 7ed42ae3b7..18cb45a38d 100644
--- a/epan/dissectors/packet-wsp.c
+++ b/epan/dissectors/packet-wsp.c
@@ -2346,7 +2346,7 @@ static guint32 wkh_profile_diff_wbxml (proto_tree *tree, tvbuff_t *tvb,
ti = proto_tree_add_string(tree, hf_hdr_profile_diff, tvb, hdr_start, offset - hdr_start,
"(Profile-Diff value as WBXML)");
subtree = proto_item_add_subtree(ti, ett_header);
- tmp_tvb = tvb_new_subset(tvb, val_start + val_len_len, val_len, val_len); /* TODO: fix 2nd length */
+ tmp_tvb = tvb_new_subset_length(tvb, val_start + val_len_len, val_len); /* TODO: fix 2nd length */
call_dissector(wbxml_uaprof_handle, tmp_tvb, pinfo, subtree);
ok = TRUE;
wkh_4_End(hf_hdr_profile_diff);
@@ -4821,7 +4821,7 @@ dissect_sir(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb, 1, len, val_len);
offset = 1 + len;
/* Application-Id headers */
- tmp_tvb = tvb_new_subset(tvb, offset, val_len, val_len);
+ tmp_tvb = tvb_new_subset_length(tvb, offset, val_len);
add_headers (subtree, tmp_tvb, hf_sir_app_id_list, pinfo);
offset += val_len;
@@ -4831,7 +4831,7 @@ dissect_sir(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb, offset, len, val_len);
offset += len;
/* WSP contact point list */
- tmp_tvb = tvb_new_subset (tvb, offset, val_len, val_len);
+ tmp_tvb = tvb_new_subset_length (tvb, offset, val_len);
add_addresses(subtree, tmp_tvb, hf_sir_wsp_contact_points);
/* End of version 0 SIR content */
@@ -4846,7 +4846,7 @@ dissect_sir(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb, offset, len, val_len);
offset += len;
/* Non-WSP contact point list */
- tmp_tvb = tvb_new_subset (tvb, offset, val_len, val_len);
+ tmp_tvb = tvb_new_subset_length(tvb, offset, val_len);
add_addresses(subtree, tmp_tvb, hf_sir_contact_points);
offset += val_len;
@@ -5037,16 +5037,16 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if (capabilityLength > 0)
{
- tmp_tvb = tvb_new_subset (tvb, offset,
- capabilityLength, capabilityLength);
+ tmp_tvb = tvb_new_subset_length (tvb, offset,
+ capabilityLength);
add_capabilities (wsp_tree, tmp_tvb, pdut);
offset += capabilityLength;
}
if (headerLength > 0)
{
- tmp_tvb = tvb_new_subset (tvb, offset,
- headerLength, headerLength);
+ tmp_tvb = tvb_new_subset_length (tvb, offset,
+ headerLength);
add_headers (wsp_tree, tmp_tvb, hf_wsp_headers_section, pinfo);
}
} /* if (tree) */
@@ -5128,8 +5128,8 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
headerLength = headersLength - (nextOffset - contentTypeStart);
if (headerLength > 0)
{
- tmp_tvb = tvb_new_subset (tvb, nextOffset,
- headerLength, headerLength);
+ tmp_tvb = tvb_new_subset_length (tvb, nextOffset,
+ headerLength);
add_headers (wsp_tree, tmp_tvb, hf_wsp_headers_section, pinfo);
}
/* XXX - offset is no longer used after this point */
@@ -5222,8 +5222,8 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
headerLength = headersLength - (nextOffset - contentTypeStart);
if (headerLength > 0)
{
- tmp_tvb = tvb_new_subset (tvb, nextOffset,
- headerLength, headerLength);
+ tmp_tvb = tvb_new_subset_length (tvb, nextOffset,
+ headerLength);
add_headers (wsp_tree, tmp_tvb, hf_wsp_headers_section, pinfo);
}
/* XXX - offset is no longer used after this point */
@@ -5301,8 +5301,8 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
headerLength = headersLength-(nextOffset-contentTypeStart);
if (headerLength > 0)
{
- tmp_tvb = tvb_new_subset (tvb, nextOffset,
- headerLength, headerLength);
+ tmp_tvb = tvb_new_subset_length (tvb, nextOffset,
+ headerLength);
add_headers (wsp_tree, tmp_tvb, hf_wsp_headers_section, pinfo);
}
/* XXX - offset is no longer used after this point */
@@ -5909,7 +5909,7 @@ add_multipart_data (proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo)
HeadersLen -= (nextOffset - offset);
if (HeadersLen > 0)
{
- tmp_tvb = tvb_new_subset (tvb, nextOffset, HeadersLen, HeadersLen);
+ tmp_tvb = tvb_new_subset_length (tvb, nextOffset, HeadersLen);
add_headers (mpart_tree, tmp_tvb, hf_wsp_headers_section, pinfo);
}
offset = nextOffset + HeadersLen;
@@ -5918,7 +5918,7 @@ add_multipart_data (proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo)
*
* TODO - handle nested multipart documents.
*/
- tmp_tvb = tvb_new_subset(tvb, offset, DataLen, DataLen);
+ tmp_tvb = tvb_new_subset_length(tvb, offset, DataLen);
/*
* Try finding a dissector for the content
* first, then fallback.
diff --git a/epan/dissectors/packet-wtp.c b/epan/dissectors/packet-wtp.c
index ae6238bdee..b3ef980973 100644
--- a/epan/dissectors/packet-wtp.c
+++ b/epan/dissectors/packet-wtp.c
@@ -383,7 +383,7 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_append_str(pinfo->cinfo, COL_INFO, ", ");
}
/* Skip the length field for the WTP sub-tvb */
- wtp_tvb = tvb_new_subset(tvb, offCur + c_fieldlen, c_pdulen, c_pdulen);
+ wtp_tvb = tvb_new_subset_length(tvb, offCur + c_fieldlen, c_pdulen);
dissect_wtp_common(wtp_tvb, pinfo, wtp_tree);
offCur += c_fieldlen + c_pdulen;
i++;
@@ -633,7 +633,7 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tpiLen = 1 + (tByte & 0x03);
if (tree)
{
- tmp_tvb = tvb_new_subset(tvb, offCur + cbHeader + vHeader, tpiLen, tpiLen);
+ tmp_tvb = tvb_new_subset_length(tvb, offCur + cbHeader + vHeader, tpiLen);
wtp_handle_tpi(wtp_tree, tmp_tvb);
}
vHeader += tpiLen;
diff --git a/epan/dissectors/packet-xmcp.c b/epan/dissectors/packet-xmcp.c
index c27f6d43af..5db656771c 100644
--- a/epan/dissectors/packet-xmcp.c
+++ b/epan/dissectors/packet-xmcp.c
@@ -763,7 +763,7 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
tvbuff_t *next_tvb;
guint8 *test_string, *tok;
- next_tvb = tvb_new_subset(tvb, offset, attr_length, attr_length);
+ next_tvb = tvb_new_subset_length(tvb, offset, attr_length);
/*
* Service-Data is usually (but not always) plain text, specifically XML.
* If it "looks like" XML (begins with optional whitespace followed by
diff --git a/epan/dissectors/packet-xml.c b/epan/dissectors/packet-xml.c
index 74a0f54361..ac311e0a72 100644
--- a/epan/dissectors/packet-xml.c
+++ b/epan/dissectors/packet-xml.c
@@ -333,7 +333,7 @@ static void after_token(void *tvbparse_data, const void *wanted_data _U_, tvbpar
new_frame->type = XML_FRAME_CDATA;
new_frame->name = NULL;
new_frame->name_orig_case = NULL;
- new_frame->value = tvb_new_subset(tok->tvb, tok->offset, tok->len, tok->len);
+ new_frame->value = tvb_new_subset_length(tok->tvb, tok->offset, tok->len);
insert_xml_frame(current_frame, new_frame);
new_frame->item = pi;
new_frame->last_item = pi;
@@ -608,8 +608,8 @@ static void after_attrib(void *tvbparse_data, const void *wanted_data _U_, tvbpa
new_frame->type = XML_FRAME_ATTRIB;
new_frame->name = name;
new_frame->name_orig_case = name_orig_case;
- new_frame->value = tvb_new_subset(value_part->tvb, value_part->offset,
- value_part->len, value_part->len);
+ new_frame->value = tvb_new_subset_length(value_part->tvb, value_part->offset,
+ value_part->len);
insert_xml_frame(current_frame, new_frame);
new_frame->item = pi;
new_frame->last_item = pi;
diff --git a/epan/dissectors/packet-zbee-aps.c b/epan/dissectors/packet-zbee-aps.c
index 7f09d496c7..5f907bb4e3 100644
--- a/epan/dissectors/packet-zbee-aps.c
+++ b/epan/dissectors/packet-zbee-aps.c
@@ -1125,9 +1125,8 @@ static void dissect_zbee_aps_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
/* Check for any excess bytes. */
if (offset < tvb_length(tvb)) {
/* There are leftover bytes! */
- guint leftover_len = tvb_length(tvb) - offset;
proto_tree *root;
- tvbuff_t *leftover_tvb = tvb_new_subset(tvb, offset, leftover_len, leftover_len);
+ tvbuff_t *leftover_tvb = tvb_new_subset_remaining(tvb, offset);
/* Get the APS Root. */
root = proto_tree_get_root(tree);
@@ -1643,7 +1642,7 @@ static int dissect_zbee_apf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Create a tvb for this transaction. */
length = zbee_apf_transaction_len(tvb, offset, type);
- app_tvb = tvb_new_subset(tvb, offset, length, length);
+ app_tvb = tvb_new_subset_length(tvb, offset, length);
/* Call the application dissector. */
call_dissector_with_data(app_dissector, app_tvb, pinfo, tree, data);
diff --git a/epan/dissectors/packet-zbee-nwk-gp.c b/epan/dissectors/packet-zbee-nwk-gp.c
index 6a81dc31c0..0a5ed1db17 100644
--- a/epan/dissectors/packet-zbee-nwk-gp.c
+++ b/epan/dissectors/packet-zbee-nwk-gp.c
@@ -1358,7 +1358,7 @@ dissect_zbee_nwk_gp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
} else if (packet.mic_size == 4) {
packet.mic = tvb_get_letohl(tvb, offset + packet.payload_len);
}
- payload_tvb = tvb_new_subset(tvb, offset, packet.payload_len, packet.payload_len);
+ payload_tvb = tvb_new_subset_length(tvb, offset, packet.payload_len);
if (packet.security_level != ZBEE_NWK_GP_SECURITY_LEVEL_FULLENCR) {
dissect_zbee_nwk_gp_cmd(payload_tvb, pinfo, nwk_tree, data);
}
diff --git a/epan/dissectors/packet-zbee-nwk.c b/epan/dissectors/packet-zbee-nwk.c
index db1373418c..9527a6260f 100644
--- a/epan/dissectors/packet-zbee-nwk.c
+++ b/epan/dissectors/packet-zbee-nwk.c
@@ -815,8 +815,7 @@ static void dissect_zbee_nwk_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
/* There is excess data in the packet. */
if (offset < tvb_length(tvb)) {
/* There are leftover bytes! */
- guint leftover_len = tvb_length(tvb) - offset;
- tvbuff_t *leftover_tvb = tvb_new_subset(tvb, offset, leftover_len, leftover_len);
+ tvbuff_t *leftover_tvb = tvb_new_subset_remaining(tvb, offset);
proto_tree *root = NULL;
/* Correct the length of the command tree. */
@@ -1641,8 +1640,7 @@ static int dissect_zbip_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (offset < tvb_length(tvb)) {
/* TODO: There are TLV's to parse. */
/* Bytes leftover! */
- guint leftover_len = tvb_length(tvb) - offset;
- tvbuff_t *leftover_tvb = tvb_new_subset(tvb, offset, leftover_len, leftover_len);
+ tvbuff_t *leftover_tvb = tvb_new_subset_remaining(tvb, offset);
proto_tree *root = NULL;
/* Correct the length of the beacon tree. */
diff --git a/epan/dissectors/packet-zbee-security.c b/epan/dissectors/packet-zbee-security.c
index bb363b4d12..cf3f5a815e 100644
--- a/epan/dissectors/packet-zbee-security.c
+++ b/epan/dissectors/packet-zbee-security.c
@@ -619,7 +619,7 @@ dissect_zbee_secure(tvbuff_t *tvb, packet_info *pinfo, proto_tree* tree, guint o
(packet.level == ZBEE_SEC_MIC128)) {
/* Payload is only integrity protected. Just return the sub-tvbuff. */
- return tvb_new_subset(tvb, offset, payload_len, payload_len);
+ return tvb_new_subset_length(tvb, offset, payload_len);
}
#ifdef HAVE_LIBGCRYPT
diff --git a/epan/dissectors/packet-zbee-zcl.c b/epan/dissectors/packet-zbee-zcl.c
index 1a20f219b7..c877d4db15 100644
--- a/epan/dissectors/packet-zbee-zcl.c
+++ b/epan/dissectors/packet-zbee-zcl.c
@@ -2483,7 +2483,7 @@ static void zcl_dump_data(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto
tvbuff_t *remainder;
if (length > 0) {
- remainder = tvb_new_subset(tvb, offset, length, length);
+ remainder = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, remainder, pinfo, root);
}
diff --git a/epan/dissectors/packet-zbee-zdp.c b/epan/dissectors/packet-zbee-zdp.c
index e3d64cfb03..2dab6aa99f 100644
--- a/epan/dissectors/packet-zbee-zdp.c
+++ b/epan/dissectors/packet-zbee-zdp.c
@@ -385,7 +385,7 @@ zdp_dump_excess(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tre
tvbuff_t *excess;
if (length > 0) {
- excess = tvb_new_subset(tvb, offset, length, length);
+ excess = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, excess, pinfo, root);
}
} /* zdp_dump_excess */
diff --git a/epan/dissectors/packet-zep.c b/epan/dissectors/packet-zep.c
index 7181e3f461..1e41eb1555 100644
--- a/epan/dissectors/packet-zep.c
+++ b/epan/dissectors/packet-zep.c
@@ -240,7 +240,7 @@ static void dissect_zep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Call the IEEE 802.15.4 dissector */
if (!((zep_data.version>=2) && (zep_data.type==ZEP_V2_TYPE_ACK))) {
- next_tvb = tvb_new_subset(tvb, zep_header_len, ieee_packet_len, ieee_packet_len);
+ next_tvb = tvb_new_subset_length(tvb, zep_header_len, ieee_packet_len);
call_dissector(next_dissector, next_tvb, pinfo, tree);
}
} /* dissect_ieee802_15_4 */