Rename tvb_new_subset() to tvb_new_subset_length_caplen().

This emphasizes that there is no such thing as *the* routine to
construct a subset tvbuff; you need to choose one of
tvb_new_subset_remaining() (if you want a new tvbuff that contains
everything past a certain point in an existing tvbuff),
tvb_new_subset_length() (if you want a subset that contains everything
past a certain point, for some number of bytes, in an existing tvbuff),
and tvb_new_subset_length_caplen() (for all other cases).

Many of the calls to tvb_new_subset_length_caplen() should really be
calling one of the other routines; that's the next step.  (This also
makes it easier to find the calls that need fixing.)

Change-Id: Ieb3d676d8cda535451c119487d7cd3b559221f2b
Reviewed-on: https://code.wireshark.org/review/19597
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2017-01-09 22:18:49 -08:00
parent 2a3b2360e1
commit 7cd6906056
171 changed files with 464 additions and 464 deletions

View File

@ -1576,8 +1576,8 @@ libwireshark.so.0 libwireshark0 #MINVER#
tvb_new_composite@Base 1.9.1
tvb_new_octet_aligned@Base 1.9.1
tvb_new_real_data@Base 1.9.1
tvb_new_subset@Base 1.9.1
tvb_new_subset_length@Base 1.9.1
tvb_new_subset_length_caplen@Base 2.3.0
tvb_new_subset_remaining@Base 1.9.1
tvb_offset_exists@Base 1.9.1
tvb_offset_from_real_beginning@Base 1.9.1

View File

@ -2225,7 +2225,7 @@ that are relevant to the next dissector).
The syntax for creating a new TVBUFF_SUBSET is:
next_tvb = tvb_new_subset(tvb, offset, length, reported_length)
next_tvb = tvb_new_subset_length_caplen(tvb, offset, length, reported_length)
or, in the common case where it should just run to the end of the packet,

View File

@ -739,11 +739,11 @@ amount of parameters:
if (new_tvb) { /* take it all */
next_tvb = new_tvb;
} else { /* make a new subset */
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
}
}
else { /* Not fragmented */
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
}
.....

View File

@ -144,7 +144,7 @@ static int dissect_cmp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pa
switch(pdu_type){
case CMP_TYPE_PKIMSG:
next_tvb = tvb_new_subset(tvb, offset, tvb_reported_length_remaining(tvb, offset), pdu_len);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_reported_length_remaining(tvb, offset), pdu_len);
dissect_cmp_pdu(next_tvb, tree, &asn1_ctx);
offset += tvb_reported_length_remaining(tvb, offset);
break;
@ -172,12 +172,12 @@ static int dissect_cmp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pa
proto_tree_add_time(tcptrans_tree, hf_cmp_tcptrans_ttcb, tvb, offset, 4, &ts);
offset += 4;
next_tvb = tvb_new_subset(tvb, offset, tvb_reported_length_remaining(tvb, offset), pdu_len);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_reported_length_remaining(tvb, offset), pdu_len);
dissect_cmp_pdu(next_tvb, tree, &asn1_ctx);
offset += tvb_reported_length_remaining(tvb, offset);
break;
case CMP_TYPE_FINALMSGREP:
next_tvb = tvb_new_subset(tvb, offset, tvb_reported_length_remaining(tvb, offset), pdu_len);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_reported_length_remaining(tvb, offset), pdu_len);
dissect_cmp_pdu(next_tvb, tree, &asn1_ctx);
offset += tvb_reported_length_remaining(tvb, offset);
break;

View File

@ -865,7 +865,7 @@ H221NonStandard/manufacturerCode VAL_PTR = &manufacturerCode
if (gefx) {
ti = proto_tree_add_string(tree, hf_h225_debug_dissector_try_string, tvb, offset>>3, 0, gefx->key);
PROTO_ITEM_SET_HIDDEN(ti);
dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset(tvb, offset>>3, 0, 0), actx->pinfo, tree, actx);
dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset_length_caplen(tvb, offset>>3, 0, 0), actx->pinfo, tree, actx);
}
actx->private_data = gefx; /* subdissector could overwrite it */
#.END

View File

@ -684,7 +684,7 @@ if (h245_pi != NULL)
if (gefx) {
ti = proto_tree_add_string(tree, hf_h245_debug_dissector_try_string, tvb, offset>>3, 0, gefx->key);
PROTO_ITEM_SET_HIDDEN(ti);
dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset(tvb, offset>>3, 0, 0), actx->pinfo, tree, actx);
dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset_length_caplen(tvb, offset>>3, 0, 0), actx->pinfo, tree, actx);
}
actx->private_data = gefx; /* subdissector could overwrite it */
#.END
@ -715,7 +715,7 @@ if (h245_pi != NULL)
if (gefx) {
ti = proto_tree_add_string(tree, hf_h245_debug_dissector_try_string, tvb, offset>>3, 0, gefx->key);
PROTO_ITEM_SET_HIDDEN(ti);
dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset(tvb, offset>>3, 0, 0), actx->pinfo, tree, actx);
dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset_length_caplen(tvb, offset>>3, 0, 0), actx->pinfo, tree, actx);
}
actx->private_data = gefx; /* subdissector could overwrite it */
#.END

View File

@ -1792,7 +1792,7 @@ dissect_krb5_AD_WIN2K_PAC_struct(proto_tree *tree, tvbuff_t *tvb, int offset, as
proto_tree_add_uint(tr, hf_krb_w2k_pac_offset, tvb, offset, 4, pac_offset);
offset += 8;
next_tvb=tvb_new_subset(tvb, pac_offset, pac_size, pac_size);
next_tvb=tvb_new_subset_length_caplen(tvb, pac_offset, pac_size, pac_size);
switch(pac_type){
case PAC_LOGON_INFO:
dissect_krb5_PAC_LOGON_INFO(tr, next_tvb, 0, actx);

View File

@ -999,7 +999,7 @@ one_more_pdu:
*/
length = length_remaining;
if (length > msg_len) length = msg_len;
msg_tvb = tvb_new_subset(tvb, offset, length, msg_len);
msg_tvb = tvb_new_subset_length_caplen(tvb, offset, length, msg_len);
/*
* Now dissect the LDAP message.
@ -1188,7 +1188,7 @@ static void
*/
length = length_remaining;
if (length > sasl_msg_len) length = sasl_msg_len;
sasl_tvb = tvb_new_subset(tvb, offset, length, sasl_msg_len);
sasl_tvb = tvb_new_subset_length_caplen(tvb, offset, length, sasl_msg_len);
proto_tree_add_uint(ldap_tree, hf_ldap_sasl_buffer_length, sasl_tvb, 0, 4, sasl_len);
@ -1214,7 +1214,7 @@ static void
tmp_length = tvb_reported_length_remaining(sasl_tvb, 4);
if ((guint)tmp_length > sasl_len)
tmp_length = sasl_len;
gssapi_tvb = tvb_new_subset(sasl_tvb, 4, tmp_length, sasl_len);
gssapi_tvb = tvb_new_subset_length_caplen(sasl_tvb, 4, tmp_length, sasl_len);
/* Attempt decryption of the GSSAPI wrapped data if possible */
gssapi_encrypt.gssapi_data_encrypted = FALSE;

View File

@ -496,7 +496,7 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
return TRUE;
}
es = tvb_new_subset(tvb, offset / 8, -1, length);
es = tvb_new_subset_length_caplen(tvb, offset / 8, -1, length);
if (tvb_get_ntoh24(es, 0) == PES_PREFIX)
dissect_mpeg_pes(es, pinfo, tree, NULL);
else if (tvb_get_guint8(es, 0) == 0xff)

View File

@ -36,7 +36,7 @@
g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
if (!err_next_tvb) { /* empty error */
err_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
err_next_tvb = tvb_new_subset_length_caplen(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
}
call_dissector_with_data((err_handle)?err_handle:data_handle, err_next_tvb, actx->pinfo, tree, actx->rose_ctx);

View File

@ -36,7 +36,7 @@
g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
if (!arg_next_tvb) { /* empty argument */
arg_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
arg_next_tvb = tvb_new_subset_length_caplen(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
}
call_dissector_with_data((arg_handle)?arg_handle:data_handle, arg_next_tvb, actx->pinfo, tree, actx->rose_ctx);

View File

@ -38,7 +38,7 @@
if (actx->rose_ctx->d.code != -1) {
if (!res_next_tvb) { /* empty result */
res_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
res_next_tvb = tvb_new_subset_length_caplen(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
}
call_dissector_with_data((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree, actx->rose_ctx);

View File

@ -1041,7 +1041,7 @@ dissect_spnego_krb5_cfx_wrap_base(tvbuff_t *tvb, int offset, packet_info *pinfo
*/
return offset;
}
gssapi_encrypt->gssapi_encrypted_tvb = tvb_new_subset(
gssapi_encrypt->gssapi_encrypted_tvb = tvb_new_subset_length_caplen(
tvb, offset, len, len);
}

View File

@ -205,7 +205,7 @@ dissect_btsnoop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
pinfo->pseudo_header->bthci.channel = BTHCI_CHANNEL_ACL;
}
next_tvb = tvb_new_subset(tvb, offset, length, length);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, length, length);
call_dissector(hci_h1_handle, next_tvb, pinfo, payload_tree);
break;
case 1002: /* H4 */
@ -213,7 +213,7 @@ dissect_btsnoop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
pinfo->abs_ts = timestamp;
pinfo->p2p_dir = (flags & 0x01) ? P2P_DIR_RECV : P2P_DIR_SENT;
next_tvb = tvb_new_subset(tvb, offset, length, length);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, length, length);
call_dissector(hci_h4_handle, next_tvb, pinfo, payload_tree);
break;
case 2001: /* Linux Monitor */
@ -223,7 +223,7 @@ dissect_btsnoop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
pinfo->pseudo_header->btmon.opcode = flags & 0xFFFF;
pinfo->pseudo_header->btmon.adapter_id = flags >> 16;
next_tvb = tvb_new_subset(tvb, offset, length, length);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, length, length);
call_dissector(hci_mon_handle, next_tvb, pinfo, payload_tree);
break;

View File

@ -187,7 +187,7 @@ dissect_pcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
if (pref_dissect_next_layer) {
TRY {
call_dissector_with_data(pcap_pktdata_handle, tvb_new_subset(tvb, offset, length, origin_length), pinfo, packet_data_tree, &link_type);
call_dissector_with_data(pcap_pktdata_handle, tvb_new_subset_length_caplen(tvb, offset, length, origin_length), pinfo, packet_data_tree, &link_type);
}
CATCH_BOUNDS_ERRORS {
show_exception(tvb, pinfo, packet_data_tree, EXCEPT_CODE, GET_MESSAGE);

View File

@ -1015,7 +1015,7 @@ static gint dissect_block(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
interface_description = (struct interface_description *) wmem_array_index(info->interfaces, interface_id);
TRY {
call_dissector_with_data(pcap_pktdata_handle, tvb_new_subset(tvb, offset, captured_length, reported_length),
call_dissector_with_data(pcap_pktdata_handle, tvb_new_subset_length_caplen(tvb, offset, captured_length, reported_length),
pinfo, packet_data_tree, &interface_description->link_type);
}
CATCH_BOUNDS_ERRORS {
@ -1216,7 +1216,7 @@ static gint dissect_block(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
interface_description = (struct interface_description *) wmem_array_index(info->interfaces, interface_id);
TRY {
call_dissector_with_data(pcap_pktdata_handle, tvb_new_subset(tvb, offset, captured_length, reported_length),
call_dissector_with_data(pcap_pktdata_handle, tvb_new_subset_length_caplen(tvb, offset, captured_length, reported_length),
pinfo, packet_data_tree, &interface_description->link_type);
}
CATCH_BOUNDS_ERRORS {

View File

@ -1527,7 +1527,7 @@ static int dissect_9P_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
len = tvb_reported_length_remaining(tvb, offset);
reportedlen = ((gint)u32&0xffff) > len ? len : (gint)u32&0xffff;
next_tvb = tvb_new_subset(tvb, offset, len, reportedlen);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, len, reportedlen);
call_data_dissector(next_tvb, pinfo, tree);
offset += len;
@ -1548,7 +1548,7 @@ static int dissect_9P_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
offset += 4;
len = tvb_reported_length_remaining(tvb, offset);
reportedlen = ((gint)u32&0xffff) > len ? len : (gint)u32&0xffff;
next_tvb = tvb_new_subset(tvb, offset, len, reportedlen);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, len, reportedlen);
call_data_dissector(next_tvb, pinfo, tree);
offset += len;

View File

@ -720,7 +720,7 @@ dissect_adb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
}
next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), tvb_captured_length_remaining(tvb, offset));
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_captured_length_remaining(tvb, offset), tvb_captured_length_remaining(tvb, offset));
call_dissector_with_data(adb_service_handle, next_tvb, pinfo, tree, &adb_service_data);
} else {

View File

@ -175,7 +175,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
adb_service_data.session_key[1] = pinfo->destport;
adb_service_data.session_key[2] = pinfo->srcport;
next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), tvb_captured_length_remaining(tvb, offset));
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_captured_length_remaining(tvb, offset), tvb_captured_length_remaining(tvb, offset));
call_dissector_with_data(adb_service_handle, next_tvb, pinfo, tree, &adb_service_data);
return tvb_captured_length(tvb);
@ -341,7 +341,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
adb_service_data.session_key[1] = pinfo->destport;
adb_service_data.session_key[2] = pinfo->srcport;
next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), tvb_captured_length_remaining(tvb, offset));
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_captured_length_remaining(tvb, offset), tvb_captured_length_remaining(tvb, offset));
call_dissector_with_data(adb_service_handle, next_tvb, pinfo, tree, &adb_service_data);
offset = tvb_captured_length(tvb);
} else {

View File

@ -7867,7 +7867,7 @@ dissect_bgp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
length = length_remaining;
if (length > bgp_len)
length = bgp_len;
next_tvb = tvb_new_subset(tvb, offset, length, bgp_len);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, length, bgp_len);
/*
* Dissect the PDU.

View File

@ -417,7 +417,7 @@ dissect_bcp_data(proto_tree *bcp_tree, packet_info *pinfo, tvbuff_t *tvb,
if (handle)
{
/* Generate a new tvb for the rest. */
next_tvb = tvb_new_subset(tvb, *offset, len, len);
next_tvb = tvb_new_subset_length_caplen(tvb, *offset, len, len);
/* Call the sub-dissector. */
call_dissector(handle, next_tvb, pinfo, bcp_tree);

View File

@ -312,7 +312,7 @@ dissect_brdwlk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _
}
fc_data.ethertype = ETHERTYPE_BRDWALK;
next_tvb = tvb_new_subset(tvb, 2, len, reported_len);
next_tvb = tvb_new_subset_length_caplen(tvb, 2, len, reported_len);
call_dissector_with_data(fc_dissector_handle, next_tvb, pinfo, tree, &fc_data);
return tvb_captured_length(tvb);
}

View File

@ -4054,7 +4054,7 @@ dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info *
const gint **hfs;
bluetooth_data_t *bluetooth_data = NULL;
tvb = tvb_new_subset(old_tvb, old_offset, length, length);
tvb = tvb_new_subset_length_caplen(old_tvb, old_offset, length, length);
DISSECTOR_ASSERT(att_data);
@ -4470,13 +4470,13 @@ dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info *
sub_tree = proto_item_add_subtree(sub_item, ett_btatt_list);
if (characteristic_dissector)
call_dissector_with_data(characteristic_dissector, tvb_new_subset(tvb, offset, tvb_reported_length_remaining(tvb, offset) / 2, tvb_reported_length_remaining(tvb, offset) / 2), pinfo, sub_tree, att_data);
call_dissector_with_data(characteristic_dissector, tvb_new_subset_length_caplen(tvb, offset, tvb_reported_length_remaining(tvb, offset) / 2, tvb_reported_length_remaining(tvb, offset) / 2), pinfo, sub_tree, att_data);
sub_item = proto_tree_add_item(tree, hf_btatt_valid_range_upper_inclusive_value, tvb, offset + tvb_reported_length_remaining(tvb, offset) / 2, tvb_reported_length_remaining(tvb, offset) / 2, ENC_NA);
sub_tree = proto_item_add_subtree(sub_item, ett_btatt_list);
if (characteristic_dissector)
call_dissector_with_data(characteristic_dissector, tvb_new_subset(tvb, offset + tvb_reported_length_remaining(tvb, offset) / 2, tvb_reported_length_remaining(tvb, offset) / 2, tvb_reported_length_remaining(tvb, offset) / 2), pinfo, sub_tree, att_data);
call_dissector_with_data(characteristic_dissector, tvb_new_subset_length_caplen(tvb, offset + tvb_reported_length_remaining(tvb, offset) / 2, tvb_reported_length_remaining(tvb, offset) / 2, tvb_reported_length_remaining(tvb, offset) / 2), pinfo, sub_tree, att_data);
offset += tvb_reported_length_remaining(tvb, offset);
}
@ -4556,7 +4556,7 @@ dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info *
proto_tree_add_item(tree, hf_btatt_value_trigger_setting_analog, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
} else if (value == 4) {
call_dissector_with_data(find_dissector("btgatt.uuid0x2a56"), tvb_new_subset(tvb, offset, 1, 1), pinfo, tree, att_data);
call_dissector_with_data(find_dissector("btgatt.uuid0x2a56"), tvb_new_subset_length_caplen(tvb, offset, 1, 1), pinfo, tree, att_data);
offset += 1;
} else if (value == 5 || value == 6) {
proto_tree_add_item(tree, hf_btatt_value_trigger_setting_analog_one, tvb, offset, 2, ENC_LITTLE_ENDIAN);
@ -6282,10 +6282,10 @@ dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info *
if (bluetooth_gatt_has_no_parameter(att_data->opcode))
break;
call_dissector_with_data(find_dissector("btgatt.uuid0x2a56"), tvb_new_subset(tvb, offset, 1, 1), pinfo, tree, att_data);
call_dissector_with_data(find_dissector("btgatt.uuid0x2a56"), tvb_new_subset_length_caplen(tvb, offset, 1, 1), pinfo, tree, att_data);
offset += 1;
call_dissector_with_data(find_dissector("btgatt.uuid0x2a58"), tvb_new_subset(tvb, offset, 2, 2), pinfo, tree, att_data);
call_dissector_with_data(find_dissector("btgatt.uuid0x2a58"), tvb_new_subset_length_caplen(tvb, offset, 2, 2), pinfo, tree, att_data);
offset += 2;
break;
@ -6382,7 +6382,7 @@ dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info *
sub_item = proto_tree_add_item(tree, hf_btatt_plx_spot_check_measurement_timestamp, tvb, offset, 7, ENC_NA);
sub_tree = proto_item_add_subtree(sub_item, ett_btatt_value);
call_dissector_with_data(find_dissector("btgatt.uuid0x2a08"), tvb_new_subset(tvb, offset, 7, 7), pinfo, sub_tree, att_data);
call_dissector_with_data(find_dissector("btgatt.uuid0x2a08"), tvb_new_subset_length_caplen(tvb, offset, 7, 7), pinfo, sub_tree, att_data);
offset += 7;
}
@ -8950,7 +8950,7 @@ dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info *
sub_item = proto_tree_add_item(tree, hf_btatt_ots_object_first_created, tvb, offset, 7, ENC_NA);
sub_tree = proto_item_add_subtree(sub_item, ett_btatt_value);
call_dissector_with_data(find_dissector("btgatt.uuid0x2a08"), tvb_new_subset(tvb, offset, 7, 7), pinfo, sub_tree, att_data);
call_dissector_with_data(find_dissector("btgatt.uuid0x2a08"), tvb_new_subset_length_caplen(tvb, offset, 7, 7), pinfo, sub_tree, att_data);
offset += 7;
break;
@ -8969,7 +8969,7 @@ dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info *
sub_item = proto_tree_add_item(tree, hf_btatt_ots_object_last_modified, tvb, offset, 7, ENC_NA);
sub_tree = proto_item_add_subtree(sub_item, ett_btatt_value);
call_dissector_with_data(find_dissector("btgatt.uuid0x2a08"), tvb_new_subset(tvb, offset, 7, 7), pinfo, sub_tree, att_data);
call_dissector_with_data(find_dissector("btgatt.uuid0x2a08"), tvb_new_subset_length_caplen(tvb, offset, 7, 7), pinfo, sub_tree, att_data);
offset += 7;
break;
@ -9176,10 +9176,10 @@ dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info *
break;
case 0x06: /* Created Between */
case 0x07: /* Modified Between */
call_dissector_with_data(find_dissector("btgatt.uuid0x2a08"), tvb_new_subset(tvb, offset, 7, 7), pinfo, tree, att_data);
call_dissector_with_data(find_dissector("btgatt.uuid0x2a08"), tvb_new_subset_length_caplen(tvb, offset, 7, 7), pinfo, tree, att_data);
offset += 7;
call_dissector_with_data(find_dissector("btgatt.uuid0x2a08"), tvb_new_subset(tvb, offset, 7, 7), pinfo, tree, att_data);
call_dissector_with_data(find_dissector("btgatt.uuid0x2a08"), tvb_new_subset_length_caplen(tvb, offset, 7, 7), pinfo, tree, att_data);
offset += 7;
break;

View File

@ -430,7 +430,7 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
length = tvb_captured_length_remaining(tvb, offset);
}
next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), length);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_captured_length_remaining(tvb, offset), length);
call_dissector_with_data(btl2cap_handle, next_tvb, pinfo, tree, acl_data);
} else if (fragmented && acl_reassembly) {
multi_fragment_pdu_t *mfp = NULL;

View File

@ -1919,7 +1919,7 @@ dissect_b_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
tvbuff_t *next_tvb;
next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), length);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_captured_length_remaining(tvb, offset), length);
col_append_str(pinfo->cinfo, COL_INFO, "Connection oriented channel");
@ -2248,7 +2248,7 @@ dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/*pass up to higher layer if we have a complete packet*/
if (segment == 0x00) {
next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset) - 2, length);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_captured_length_remaining(tvb, offset) - 2, length);
}
if (next_tvb) {
if (psm) {
@ -2608,7 +2608,7 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(btl2cap_tree, hf_btl2cap_psm, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), length);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_captured_length_remaining(tvb, offset), length);
/* call next dissector */
if (!dissector_try_uint_new(l2cap_psm_dissector_table, (guint32) psm, next_tvb, pinfo, tree, TRUE, l2cap_data)) {
@ -2662,11 +2662,11 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
offset += 2;
proto_tree_add_item(btl2cap_tree, hf_btl2cap_fcs, tvb, tvb_reported_length(tvb) - 2, 2, ENC_LITTLE_ENDIAN);
next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset)-2, length);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_captured_length_remaining(tvb, offset)-2, length);
}
}
else {
next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), length);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_captured_length_remaining(tvb, offset), length);
}
/* call next dissector */
if (next_tvb && !dissector_try_uint_new(l2cap_cid_dissector_table, (guint32) cid,

View File

@ -286,7 +286,7 @@ dissect_bvlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
* BACnet NPDU
*/
npdu_length = packet_length - bvlc_length;
next_tvb = tvb_new_subset(tvb,bvlc_length,-1,npdu_length);
next_tvb = tvb_new_subset_length_caplen(tvb,bvlc_length,-1,npdu_length);
/* Code from Guy Harris */
if (!dissector_try_uint(bvlc_dissector_table,
bvlc_function, next_tvb, pinfo, tree)) {

View File

@ -4253,7 +4253,7 @@ static int dissect_c15ch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
proto_tree_add_item(c15ch_tree, hf_c15ch_realtime, tvb, 32, 4, ENC_BIG_ENDIAN);
}
next_tvb = tvb_new_subset(tvb, HEADER_SZ, -1, payload_length);
next_tvb = tvb_new_subset_length_caplen(tvb, HEADER_SZ, -1, payload_length);
/* call dissector to dissect the rest of the packet, based on msg_type */
retv = HEADER_SZ + dissector_try_uint(c15ch_dissector_table, msg_type, next_tvb, pinfo, tree);
return retv;
@ -4621,7 +4621,7 @@ static int dissect_c15ch_encap_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tre
tvb, 1, 4, ENC_BIG_ENDIAN);
/*length of ISUP portion == expected length == 268 */
next_tvb = tvb_new_subset(tvb, 5, 268, 268);
next_tvb = tvb_new_subset_length_caplen(tvb, 5, 268, 268);
call_dissector(general_isup_handle, next_tvb, pinfo, tree);
}
@ -4696,7 +4696,7 @@ static int dissect_c15ch_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
tvb, 41, 8, ENC_NA);
/*length of ISUP portion == expected length == 271 */
next_tvb = tvb_new_subset(tvb, 49, 271, 271);
next_tvb = tvb_new_subset_length_caplen(tvb, 49, 271, 271);
call_dissector(general_isup_handle, next_tvb, pinfo, tree);
}
@ -5470,7 +5470,7 @@ static int dissect_c15ch_q931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
tvb, 9, 4, ENC_BIG_ENDIAN);
if (q931_msg_len && bytes_to_skip)
{
next_tvb = tvb_new_subset(tvb, 13 + bytes_to_skip, q931_msg_len - bytes_to_skip, q931_msg_len - bytes_to_skip);
next_tvb = tvb_new_subset_length_caplen(tvb, 13 + bytes_to_skip, q931_msg_len - bytes_to_skip, q931_msg_len - bytes_to_skip);
call_dissector(general_q931_handle, next_tvb, pinfo, tree);
}
}
@ -5658,7 +5658,7 @@ static int dissect_c15ch_sccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
tvb, 298, 4, ENC_BIG_ENDIAN);
/* skip bytes to get to SCCP message type */
next_tvb = tvb_new_subset(tvb, 23 + 2,
next_tvb = tvb_new_subset_length_caplen(tvb, 23 + 2,
275 - 2, 275 - 2);
/* sccp dissector call */
@ -5978,7 +5978,7 @@ static int dissect_c15ch_inc_gwe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
proto_tree_add_item(c15ch_inc_gwe_tree, hf_c15ch_inc_gwe_datatype,
tvb, 10, 1, ENC_BIG_ENDIAN);
}
next_tvb = tvb_new_subset(tvb, 11, -1, -1);
next_tvb = tvb_new_subset_length_caplen(tvb, 11, -1, -1);
/*third level dissection*/
retv = 11 + dissector_try_uint(c15ch_inc_gwe_dissector_table, type_num, next_tvb, pinfo, tree);
return retv;
@ -6641,7 +6641,7 @@ static int dissect_c15ch_out_gwe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
proto_tree_add_item(c15ch_out_gwe_tree, hf_c15ch_out_gwe_gwe_data_type,
tvb, 14, 1, ENC_BIG_ENDIAN);
}
next_tvb = tvb_new_subset(tvb, 15, -1, -1);
next_tvb = tvb_new_subset_length_caplen(tvb, 15, -1, -1);
dissector_try_uint(c15ch_out_gwe_dissector_table, data_type, next_tvb, pinfo, tree);
return tvb_reported_length(tvb);
@ -7208,7 +7208,7 @@ static int dissect_c15ch_tone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
proto_tree_add_item(c15ch_tone_tree, hf_c15ch_tone_msg_type,
tvb, 0, 1, ENC_BIG_ENDIAN);
}
next_tvb = tvb_new_subset(tvb, 1, -1, -1);
next_tvb = tvb_new_subset_length_caplen(tvb, 1, -1, -1);
retv = 1 + dissector_try_uint(c15ch_tone_dissector_table, msg_type, next_tvb, pinfo, tree);
return retv;
}

View File

@ -1558,7 +1558,7 @@ static int dissect_cmp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pa
switch(pdu_type){
case CMP_TYPE_PKIMSG:
next_tvb = tvb_new_subset(tvb, offset, tvb_reported_length_remaining(tvb, offset), pdu_len);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_reported_length_remaining(tvb, offset), pdu_len);
dissect_cmp_pdu(next_tvb, tree, &asn1_ctx);
offset += tvb_reported_length_remaining(tvb, offset);
break;
@ -1586,12 +1586,12 @@ static int dissect_cmp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pa
proto_tree_add_time(tcptrans_tree, hf_cmp_tcptrans_ttcb, tvb, offset, 4, &ts);
offset += 4;
next_tvb = tvb_new_subset(tvb, offset, tvb_reported_length_remaining(tvb, offset), pdu_len);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_reported_length_remaining(tvb, offset), pdu_len);
dissect_cmp_pdu(next_tvb, tree, &asn1_ctx);
offset += tvb_reported_length_remaining(tvb, offset);
break;
case CMP_TYPE_FINALMSGREP:
next_tvb = tvb_new_subset(tvb, offset, tvb_reported_length_remaining(tvb, offset), pdu_len);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_reported_length_remaining(tvb, offset), pdu_len);
dissect_cmp_pdu(next_tvb, tree, &asn1_ctx);
offset += tvb_reported_length_remaining(tvb, offset);
break;

View File

@ -174,7 +174,7 @@ dissect_componentstatusprotocol_componentstatusreport_message(tvbuff_t *message_
while(tvb_reported_length_remaining(message_tvb, offset) >= COMPONENTASSOCIATION_LENGTH) {
association_tree = proto_tree_add_subtree_format(message_tree, message_tvb, offset, COMPONENTASSOCIATION_LENGTH,
ett_association, NULL, "Association #%d", i++);
association_tvb = tvb_new_subset(message_tvb, offset,
association_tvb = tvb_new_subset_length_caplen(message_tvb, offset,
MIN(COMPONENTASSOCIATION_LENGTH, tvb_reported_length_remaining(message_tvb, offset)),
COMPONENTASSOCIATION_LENGTH);

View File

@ -347,7 +347,7 @@ dissect_corosynec_totemnet_with_decryption(tvbuff_t *tvb,
dissect_corosync_totemnet_security_header(decrypted_tvb, pinfo, parent_tree,
check_crypt_type, key_for_trial);
next_tvb = tvb_new_subset(decrypted_tvb,
next_tvb = tvb_new_subset_length_caplen(decrypted_tvb,
SHA1_DIGEST_LEN + SALT_SIZE,
io_len - (SHA1_DIGEST_LEN + SALT_SIZE),
io_len - (SHA1_DIGEST_LEN + SALT_SIZE));

View File

@ -1217,7 +1217,7 @@ dissect_multipath_lookup_response(tvbuff_t *tvb, packet_info *pinfo,
proto_tree_add_item(multipath_tree, hf_value, tvb, offset, result_len,
ENC_ASCII | ENC_NA);
if (result_len > 0) {
json_tvb = tvb_new_subset(tvb, offset, result_len, result_len);
json_tvb = tvb_new_subset_length_caplen(tvb, offset, result_len, result_len);
call_dissector(json_handle, json_tvb, pinfo, multipath_tree);
}
offset += result_len;
@ -1267,7 +1267,7 @@ dissect_multipath_mutation_response(tvbuff_t *tvb, packet_info *pinfo,
proto_tree_add_item(multipath_tree, hf_value, tvb, offset, result_len,
ENC_ASCII | ENC_NA);
if (result_len > 0) {
json_tvb = tvb_new_subset(tvb, offset, result_len, result_len);
json_tvb = tvb_new_subset_length_caplen(tvb, offset, result_len, result_len);
call_dissector(json_handle, json_tvb, pinfo, multipath_tree);
}
offset += result_len;
@ -1473,7 +1473,7 @@ dissect_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
} else if (!request && has_json_value(opcode)) {
tvbuff_t *json_tvb;
ti = proto_tree_add_item(tree, hf_value, tvb, offset, value_len, ENC_ASCII | ENC_NA);
json_tvb = tvb_new_subset(tvb, offset, value_len, value_len);
json_tvb = tvb_new_subset_length_caplen(tvb, offset, value_len, value_len);
call_dissector(json_handle, json_tvb, pinfo, tree);
} else if (opcode == PROTOCOL_BINARY_CMD_SUBDOC_MULTI_LOOKUP ||
@ -1683,7 +1683,7 @@ dissect_couchbase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
ENC_ASCII | ENC_NA);
if (status == PROTOCOL_BINARY_RESPONSE_NOT_MY_VBUCKET) {
tvbuff_t *json_tvb;
json_tvb = tvb_new_subset(tvb, offset, bodylen, bodylen);
json_tvb = tvb_new_subset_length_caplen(tvb, offset, bodylen, bodylen);
call_dissector(json_handle, json_tvb, pinfo, couchbase_tree);
} else if (opcode == PROTOCOL_BINARY_CMD_SUBDOC_MULTI_LOOKUP) {

View File

@ -970,7 +970,7 @@ dissect_cp2179(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
cp2179_tvb = clean_telnet_iac(pinfo, tvb, 0, length);
}
else{
/* cp2179_tvb = tvb_new_subset( tvb, 0, length, length); */
/* cp2179_tvb = tvb_new_subset_length_caplen( tvb, 0, length, length); */
cp2179_tvb = tvb_new_subset_length( tvb, 0, length);
}

View File

@ -368,7 +368,7 @@ dissect_cpfi(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, void *
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);
body_tvb = tvb_new_subset_length_caplen(message_tvb, 8, body_length, reported_body_length);
fc_data.ethertype = 0;
call_dissector_with_data(fc_handle, body_tvb, pinfo, tree, &fc_data);
@ -377,7 +377,7 @@ dissect_cpfi(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, void *
col_prepend_fstr(pinfo->cinfo, COL_INFO, direction_and_port_string, left, arrow, right);
/* Do the footer */
footer_tvb = tvb_new_subset(message_tvb, 8+body_length, length, 8);
footer_tvb = tvb_new_subset_length_caplen(message_tvb, 8+body_length, length, 8);
dissect_cpfi_footer(footer_tvb, cpfi_tree);
return(tvb_reported_length(message_tvb));

View File

@ -2917,7 +2917,7 @@ dnsserver_dissect_element_DnssrvEnumRecords2_record_buffer_(tvbuff_t *tvb _U_, i
guint32 saved_flags = di->call_data->flags;
offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep, hf_dnsserver_DnssrvEnumRecords2_record_buffer_, &size);
di->call_data->flags &= ~DCERPC_IS_NDR64;
subtvb = tvb_new_subset(tvb, offset, (const gint)size, -1);
subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);
dnsserver_dissect_element_DnssrvEnumRecords2_record_buffer__(subtvb, 0, pinfo, tree, di, drep);
offset += (int)size;
di->call_data->flags = saved_flags;

View File

@ -287,7 +287,7 @@ eventlog_dissect_element_ReadEventLogW_data_(tvbuff_t *tvb, int offset, packet_i
* NDR encoded at all and there are byte offsets into this buffer
* encoded therein.
*/
record_tvb=tvb_new_subset(tvb, offset, MIN((gint)len, tvb_captured_length_remaining(tvb, offset)), len);
record_tvb=tvb_new_subset_length_caplen(tvb, offset, MIN((gint)len, tvb_captured_length_remaining(tvb, offset)), len);
eventlog_dissect_struct_Record(record_tvb, 0, pinfo, tree, di, drep, hf_eventlog_Record, 0);
offset+=len;
return offset;
@ -312,7 +312,7 @@ eventlog_dissect_element_Record_sid_offset(tvbuff_t *tvb, int offset, packet_inf
/* this blob contains an NT SID.
* tvb starts at the beginning of the record.
*/
sid_tvb=tvb_new_subset(tvb, sid_offset, MIN((gint)sid_length, tvb_captured_length_remaining(tvb, offset)), sid_length);
sid_tvb=tvb_new_subset_length_caplen(tvb, sid_offset, MIN((gint)sid_length, tvb_captured_length_remaining(tvb, offset)), sid_length);
dissect_nt_sid(sid_tvb, 0, tree, "SID", NULL, -1);
}
return offset;

View File

@ -739,7 +739,7 @@ frsrpc_dissect_element_CommPktChunkGuidName_guid(tvbuff_t *tvb _U_, int offset _
guint32 saved_flags = di->call_data->flags;
offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep, hf_frsrpc_frsrpc_CommPktChunkGuidName_guid_, &size);
di->call_data->flags &= ~DCERPC_IS_NDR64;
subtvb = tvb_new_subset(tvb, offset, (const gint)size, -1);
subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);
frsrpc_dissect_element_CommPktChunkGuidName_guid_(subtvb, 0, pinfo, tree, di, drep);
offset += (int)size;
di->call_data->flags = saved_flags;
@ -767,7 +767,7 @@ frsrpc_dissect_element_CommPktChunkGuidName_name(tvbuff_t *tvb _U_, int offset _
guint32 saved_flags = di->call_data->flags;
offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep, hf_frsrpc_frsrpc_CommPktChunkGuidName_name_, &size);
di->call_data->flags &= ~DCERPC_IS_NDR64;
subtvb = tvb_new_subset(tvb, offset, (const gint)size, -1);
subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);
frsrpc_dissect_element_CommPktChunkGuidName_name_(subtvb, 0, pinfo, tree, di, drep);
offset += (int)size;
di->call_data->flags = saved_flags;
@ -2150,7 +2150,7 @@ frsrpc_dissect_element_CommPktChunkData_join_guid(tvbuff_t *tvb _U_, int offset
guint32 saved_flags = di->call_data->flags;
offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep, hf_frsrpc_frsrpc_CommPktChunkData_join_guid_, &size);
di->call_data->flags &= ~DCERPC_IS_NDR64;
subtvb = tvb_new_subset(tvb, offset, (const gint)size, -1);
subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);
frsrpc_dissect_element_CommPktChunkData_join_guid_(subtvb, 0, pinfo, tree, di, drep);
offset += (int)size;
di->call_data->flags = saved_flags;
@ -2186,7 +2186,7 @@ frsrpc_dissect_element_CommPktChunkData_vvector(tvbuff_t *tvb _U_, int offset _U
guint32 saved_flags = di->call_data->flags;
offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep, hf_frsrpc_frsrpc_CommPktChunkData_vvector_, &size);
di->call_data->flags &= ~DCERPC_IS_NDR64;
subtvb = tvb_new_subset(tvb, offset, (const gint)size, -1);
subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);
frsrpc_dissect_element_CommPktChunkData_vvector_(subtvb, 0, pinfo, tree, di, drep);
offset += (int)size;
di->call_data->flags = saved_flags;
@ -2214,7 +2214,7 @@ frsrpc_dissect_element_CommPktChunkData_join_time(tvbuff_t *tvb _U_, int offset
guint32 saved_flags = di->call_data->flags;
offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep, hf_frsrpc_frsrpc_CommPktChunkData_join_time_, &size);
di->call_data->flags &= ~DCERPC_IS_NDR64;
subtvb = tvb_new_subset(tvb, offset, (const gint)size, -1);
subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);
frsrpc_dissect_element_CommPktChunkData_join_time_(subtvb, 0, pinfo, tree, di, drep);
offset += (int)size;
di->call_data->flags = saved_flags;
@ -2242,7 +2242,7 @@ frsrpc_dissect_element_CommPktChunkData_replica_version_guid(tvbuff_t *tvb _U_,
guint32 saved_flags = di->call_data->flags;
offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep, hf_frsrpc_frsrpc_CommPktChunkData_replica_version_guid_, &size);
di->call_data->flags &= ~DCERPC_IS_NDR64;
subtvb = tvb_new_subset(tvb, offset, (const gint)size, -1);
subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);
frsrpc_dissect_element_CommPktChunkData_replica_version_guid_(subtvb, 0, pinfo, tree, di, drep);
offset += (int)size;
di->call_data->flags = saved_flags;
@ -2310,7 +2310,7 @@ frsrpc_dissect_element_CommPktChunkData_gvsn(tvbuff_t *tvb _U_, int offset _U_,
guint32 saved_flags = di->call_data->flags;
offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep, hf_frsrpc_frsrpc_CommPktChunkData_gvsn_, &size);
di->call_data->flags &= ~DCERPC_IS_NDR64;
subtvb = tvb_new_subset(tvb, offset, (const gint)size, -1);
subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);
frsrpc_dissect_element_CommPktChunkData_gvsn_(subtvb, 0, pinfo, tree, di, drep);
offset += (int)size;
di->call_data->flags = saved_flags;
@ -2338,7 +2338,7 @@ frsrpc_dissect_element_CommPktChunkData_co_guid(tvbuff_t *tvb _U_, int offset _U
guint32 saved_flags = di->call_data->flags;
offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep, hf_frsrpc_frsrpc_CommPktChunkData_co_guid_, &size);
di->call_data->flags &= ~DCERPC_IS_NDR64;
subtvb = tvb_new_subset(tvb, offset, (const gint)size, -1);
subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);
frsrpc_dissect_element_CommPktChunkData_co_guid_(subtvb, 0, pinfo, tree, di, drep);
offset += (int)size;
di->call_data->flags = saved_flags;
@ -2374,7 +2374,7 @@ frsrpc_dissect_element_CommPktChunkData_remote_co(tvbuff_t *tvb _U_, int offset
guint32 saved_flags = di->call_data->flags;
offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep, hf_frsrpc_frsrpc_CommPktChunkData_remote_co_, &size);
di->call_data->flags &= ~DCERPC_IS_NDR64;
subtvb = tvb_new_subset(tvb, offset, (const gint)size, -1);
subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);
frsrpc_dissect_element_CommPktChunkData_remote_co_(subtvb, 0, pinfo, tree, di, drep);
offset += (int)size;
di->call_data->flags = saved_flags;
@ -2402,7 +2402,7 @@ frsrpc_dissect_element_CommPktChunkData_co_ext_win2k(tvbuff_t *tvb _U_, int offs
guint32 saved_flags = di->call_data->flags;
offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep, hf_frsrpc_frsrpc_CommPktChunkData_co_ext_win2k_, &size);
di->call_data->flags &= ~DCERPC_IS_NDR64;
subtvb = tvb_new_subset(tvb, offset, (const gint)size, -1);
subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);
frsrpc_dissect_element_CommPktChunkData_co_ext_win2k_(subtvb, 0, pinfo, tree, di, drep);
offset += (int)size;
di->call_data->flags = saved_flags;
@ -2575,7 +2575,7 @@ frsrpc_dissect_element_CommPktChunk_data(tvbuff_t *tvb _U_, int offset _U_, pack
guint32 saved_flags = di->call_data->flags;
offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep, hf_frsrpc_frsrpc_CommPktChunk_data_, &size);
di->call_data->flags &= ~DCERPC_IS_NDR64;
subtvb = tvb_new_subset(tvb, offset, (const gint)size, -1);
subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);
frsrpc_dissect_element_CommPktChunk_data_(subtvb, 0, pinfo, tree, di, drep, type);
offset += (int)size;
di->call_data->flags = saved_flags;
@ -2725,7 +2725,7 @@ frsrpc_dissect_element_FrsSendCommPktReq_ctr_(tvbuff_t *tvb _U_, int offset _U_,
guint32 saved_flags = di->call_data->flags;
offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep, hf_frsrpc_frsrpc_FrsSendCommPktReq_ctr_, &size);
di->call_data->flags &= ~DCERPC_IS_NDR64;
subtvb = tvb_new_subset(tvb, offset, (const gint)size, -1);
subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);
frsrpc_dissect_element_FrsSendCommPktReq_ctr__(subtvb, 0, pinfo, tree, di, drep);
offset += (int)size;
di->call_data->flags = saved_flags;
@ -3160,7 +3160,7 @@ frsrpc_dissect_element_FrsStartPromotionParent_connection_guid_(tvbuff_t *tvb _U
guint32 saved_flags = di->call_data->flags;
offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep, hf_frsrpc_frsrpc_FrsStartPromotionParent_connection_guid_, &size);
di->call_data->flags &= ~DCERPC_IS_NDR64;
subtvb = tvb_new_subset(tvb, offset, (const gint)size, -1);
subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);
frsrpc_dissect_element_FrsStartPromotionParent_connection_guid__(subtvb, 0, pinfo, tree, di, drep);
offset += (int)size;
di->call_data->flags = saved_flags;
@ -3196,7 +3196,7 @@ frsrpc_dissect_element_FrsStartPromotionParent_partner_guid_(tvbuff_t *tvb _U_,
guint32 saved_flags = di->call_data->flags;
offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep, hf_frsrpc_frsrpc_FrsStartPromotionParent_partner_guid_, &size);
di->call_data->flags &= ~DCERPC_IS_NDR64;
subtvb = tvb_new_subset(tvb, offset, (const gint)size, -1);
subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);
frsrpc_dissect_element_FrsStartPromotionParent_partner_guid__(subtvb, 0, pinfo, tree, di, drep);
offset += (int)size;
di->call_data->flags = saved_flags;
@ -3232,7 +3232,7 @@ frsrpc_dissect_element_FrsStartPromotionParent_parent_guid_(tvbuff_t *tvb _U_, i
guint32 saved_flags = di->call_data->flags;
offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep, hf_frsrpc_frsrpc_FrsStartPromotionParent_parent_guid_, &size);
di->call_data->flags &= ~DCERPC_IS_NDR64;
subtvb = tvb_new_subset(tvb, offset, (const gint)size, -1);
subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);
frsrpc_dissect_element_FrsStartPromotionParent_parent_guid__(subtvb, 0, pinfo, tree, di, drep);
offset += (int)size;
di->call_data->flags = saved_flags;

View File

@ -85,7 +85,7 @@ krb5rpc_dissect_sendto_kdc_rqst (tvbuff_t * tvb, int offset,
subtree = proto_item_add_subtree (item, ett_krb5rpc_krb5);
remain = tvb_captured_length_remaining(tvb, offset);
krb5_tvb = tvb_new_subset (tvb, offset, remain, remain);
krb5_tvb = tvb_new_subset_length_caplen (tvb, offset, remain, remain);
offset = dissect_kerberos_main (krb5_tvb, pinfo, subtree, TRUE, NULL);
@ -130,7 +130,7 @@ krb5rpc_dissect_sendto_kdc_resp (tvbuff_t * tvb, int offset,
item = proto_tree_add_item (tree, hf_krb5rpc_krb5, tvb, offset, -1, ENC_NA);
subtree = proto_item_add_subtree (item, ett_krb5rpc_krb5);
remain = tvb_captured_length_remaining(tvb, offset);
krb5_tvb = tvb_new_subset (tvb, offset, remain, remain);
krb5_tvb = tvb_new_subset_length_caplen (tvb, offset, remain, remain);
offset = dissect_kerberos_main (krb5_tvb, pinfo, subtree, TRUE, NULL);
offset += 16; /* no idea what this is, probably just extended encrypted text. */

View File

@ -1572,7 +1572,7 @@ lsarpc_dissect_element_lsa_DomainInfoEfs_efs_blob_(tvbuff_t *tvb _U_, int offset
if (len > tvb_captured_length_remaining(tvb, offset)) {
len = tvb_captured_length_remaining(tvb, offset);
}
next_tvb = tvb_new_subset(tvb, offset, len, reported_len);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, len, reported_len);
efsblob_handle = find_dissector("efsblob");
if (efsblob_handle) {
call_dissector(efsblob_handle, next_tvb, pinfo, tree);

View File

@ -4278,7 +4278,7 @@ mapi_dissect_element_EcDoRpc_response__(tvbuff_t *tvb _U_, int offset _U_, packe
guint16 length;
tvbuff_t *subtvb;
length = tvb_get_letohs(tvb, offset);
subtvb = tvb_new_subset(tvb, offset, length, length);
subtvb = tvb_new_subset_length_caplen(tvb, offset, length, length);
offset += 2;
while (offset < length) {
offset = mapi_dissect_struct_EcDoRpc_MAPI_REPL(subtvb, offset, pinfo, tree, di, drep, hf_mapi_mapi_response_mapi_repl, length - offset);
@ -9118,7 +9118,7 @@ mapi_dissect_element_OpenMessage_recipients_recipients_headers(tvbuff_t *tvb _U_
guint32 saved_flags = di->call_data->flags;
offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, di, drep, hf_mapi_OpenMessage_recipients_recipients_headers_, &size);
di->call_data->flags &= ~DCERPC_IS_NDR64;
subtvb = tvb_new_subset(tvb, offset, (const gint)size, -1);
subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);
mapi_dissect_element_OpenMessage_recipients_recipients_headers_(subtvb, 0, pinfo, tree, di, drep);
offset += (int)size;
di->call_data->flags = saved_flags;

View File

@ -1532,7 +1532,7 @@ dissect_dcerpc_guid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
if (length > reported_length)
length = reported_length;
stub_tvb = tvb_new_subset(tvb, 0, length, reported_length);
stub_tvb = tvb_new_subset_length_caplen(tvb, 0, length, reported_length);
auth_pad_len = dissector_data->auth_info->auth_pad_len;
auth_pad_offset = reported_length;
} else {
@ -1604,7 +1604,7 @@ dissect_dcerpc_guid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
length, plurality(length, "", "s"));
}
payload_tvb = tvb_new_subset(stub_tvb, 0, length, length);
payload_tvb = tvb_new_subset_length_caplen(stub_tvb, 0, length, length);
offset = sub_dissect(payload_tvb, 0, pinfo, sub_tree,
dissector_data->info, dissector_data->drep);
@ -3768,7 +3768,7 @@ dissect_dcerpc_cn_auth(tvbuff_t *tvb, int stub_offset, packet_info *pinfo,
/*
* Dissect the authentication data.
*/
auth_info->auth_tvb = tvb_new_subset(tvb, offset,
auth_info->auth_tvb = tvb_new_subset_length_caplen(tvb, offset,
MIN(hdr->auth_len,tvb_reported_length_remaining(tvb, offset)),
hdr->auth_len);
@ -4215,7 +4215,7 @@ dissect_dcerpc_cn_stub(tvbuff_t *tvb, int offset, packet_info *pinfo,
reported_length -= auth_info->auth_size;
if (length > reported_length)
length = reported_length;
payload_tvb = tvb_new_subset(tvb, offset, length, reported_length);
payload_tvb = tvb_new_subset_length_caplen(tvb, offset, length, reported_length);
/* Decrypt the PDU if it is encrypted */
@ -5434,7 +5434,7 @@ dissect_dcerpc_cn(tvbuff_t *tvb, int offset, packet_info *pinfo,
* offset otherwise.
*/
subtvb_len = MIN(hdr.frag_len, tvb_reported_length(tvb));
fragment_tvb = tvb_new_subset(tvb, start_offset,
fragment_tvb = tvb_new_subset_length_caplen(tvb, start_offset,
subtvb_len /* length */,
hdr.frag_len /* reported_length */);
@ -5913,7 +5913,7 @@ dissect_dcerpc_dg_stub(tvbuff_t *tvb, int offset, packet_info *pinfo,
* XXX - authentication info?
*/
pinfo->fragmented = (hdr->flags1 & PFCL1_FRAG);
next_tvb = tvb_new_subset(tvb, offset, length,
next_tvb = tvb_new_subset_length_caplen(tvb, offset, length,
reported_length);
dcerpc_try_handoff(pinfo, tree, dcerpc_tree, next_tvb, TRUE, hdr->drep, di, NULL);
} else {

View File

@ -570,7 +570,7 @@ dissect_af (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _
pt = tvb_get_guint8 (tvb, offset);
proto_tree_add_item (af_tree, hf_edcp_pt, tvb, offset, 1, ENC_ASCII|ENC_NA);
offset += 1;
next_tvb = tvb_new_subset (tvb, offset, payload_len, payload_len);
next_tvb = tvb_new_subset_length_caplen (tvb, offset, payload_len, payload_len);
offset += payload_len;
ci = proto_tree_add_item (af_tree, hf_edcp_crc, tvb, offset, 2, ENC_BIG_ENDIAN);
if (ver & 0x80) { /* crc valid */
@ -621,7 +621,7 @@ dissect_tpl(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _
offset, 8+bytes, NULL,
"%s (%u bits)", tag, bits);
next_tvb = tvb_new_subset (tvb, offset+8, bytes, bytes);
next_tvb = tvb_new_subset_length_caplen (tvb, offset+8, bytes, bytes);
dissector_try_string(tpl_dissector_table, tag, next_tvb, pinfo, tree, NULL);
offset += (8+bytes);

View File

@ -394,7 +394,7 @@ dissect_dlsw_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
switch (mtype)
{
case CAP_EXCHANGE:
dissect_dlsw_capex(tvb_new_subset(tvb, hlen, mlen, -1), pinfo, dlsw_data_tree, ti2);
dissect_dlsw_capex(tvb_new_subset_length_caplen(tvb, hlen, mlen, -1), pinfo, dlsw_data_tree, ti2);
break;
case IFCM:
case INFOFRAME:

View File

@ -2522,7 +2522,7 @@ static int dissect_2008_16_security_2(tvbuff_t *tvb, packet_info *pinfo, proto_t
{
proto_item *ti = proto_tree_add_item(tree, hf_security_2_permission, tvb, offset, -1, ENC_NA);
proto_tree *subtree = proto_item_add_subtree(ti, ett_security_2_permission);
tvbuff_t *next_tvb = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
gint len = dissect_2008_16_security_1(next_tvb, pinfo, subtree, NULL);
proto_item_set_len(ti, len);
offset += len;
@ -2564,7 +2564,7 @@ static int dissect_2008_16_security_3_1(tvbuff_t *tvb, packet_info *pinfo, proto
/* Security Node Identifier */
{
int block_length;
tvbuff_t *start = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *start = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
proto_tree *subtree;
ti = proto_tree_add_item(tree, hf_security_3_1_security_node_identifier, tvb, offset, 0, ENC_NA);
subtree = proto_item_add_subtree(ti, ett_security_3_1_security_node_identifier);
@ -2641,7 +2641,7 @@ static int dissect_2008_16_security_4(tvbuff_t *tvb, packet_info *pinfo, proto_t
{
int block_length;
tvbuff_t *start = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *start = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
proto_item *ti;
proto_tree *subtree;
dof_2008_16_security_3_1 return_3_1;
@ -2659,7 +2659,7 @@ static int dissect_2008_16_security_4(tvbuff_t *tvb, packet_info *pinfo, proto_t
}
{
tvbuff_t *start = tvb_new_subset(tvb, offset, (flag & 0x0F) + 1, (flag & 0x0F) + 1);
tvbuff_t *start = tvb_new_subset_length_caplen(tvb, offset, (flag & 0x0F) + 1, (flag & 0x0F) + 1);
if (return_data)
return_data->nonce = start;
@ -2669,7 +2669,7 @@ static int dissect_2008_16_security_4(tvbuff_t *tvb, packet_info *pinfo, proto_t
{
int block_length;
tvbuff_t *start = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *start = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
proto_item *ti;
proto_tree *subtree;
@ -2717,7 +2717,7 @@ static int dissect_2008_16_security_6_1(tvbuff_t *tvb, packet_info *pinfo, proto
/* Desired Security Mode */
{
int block_length;
tvbuff_t *start = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *start = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
proto_item *ti;
proto_tree *subtree;
@ -2741,7 +2741,7 @@ static int dissect_2008_16_security_6_1(tvbuff_t *tvb, packet_info *pinfo, proto
{
int block_length;
dof_2008_16_security_4 output;
tvbuff_t *start = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *start = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
proto_item *ti;
proto_tree *subtree;
@ -2774,7 +2774,7 @@ static int dissect_2008_16_security_6_2(tvbuff_t *tvb, packet_info *pinfo, proto
{
int block_length;
dof_2008_16_security_4 output;
tvbuff_t *start = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *start = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
proto_item *ti;
proto_tree *subtree;
@ -2808,7 +2808,7 @@ static int dissect_2008_16_security_6_3(tvbuff_t *tvb, packet_info *pinfo, proto
/* Session Security Scope */
{
int block_length;
tvbuff_t *start = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *start = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
proto_item *ti;
proto_tree *subtree;
@ -2822,7 +2822,7 @@ static int dissect_2008_16_security_6_3(tvbuff_t *tvb, packet_info *pinfo, proto
/* Initiator Validation */
{
int block_length;
tvbuff_t *start = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *start = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
proto_item *ti;
proto_tree *subtree;
@ -2836,7 +2836,7 @@ static int dissect_2008_16_security_6_3(tvbuff_t *tvb, packet_info *pinfo, proto
/* Responder Validation */
{
int block_length;
tvbuff_t *start = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *start = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
proto_item *ti;
proto_tree *subtree;
@ -2982,7 +2982,7 @@ static int dissect_2008_16_security_11(tvbuff_t *tvb, packet_info *pinfo, proto_
{
proto_item *ti = proto_tree_add_item(tree, hf_security_11_permission_security_scope, tvb, offset, -1, ENC_NA);
proto_tree *subtree = proto_item_add_subtree(ti, ett_security_11_permission_security_scope);
tvbuff_t *next_tvb = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
gint len;
len = dissect_2008_16_security_12(next_tvb, pinfo, subtree, NULL);
proto_item_set_len(ti, len);
@ -3122,7 +3122,7 @@ static gint dissect_2009_11_type_4(tvbuff_t *tvb, packet_info *pinfo, proto_tree
do
{
tvbuff_t *packet = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *packet = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
proto_tree *attribute_tree;
gint attribute_length;
@ -3194,7 +3194,7 @@ static int dissect_2009_11_type_5(tvbuff_t *tvb, packet_info *pinfo, proto_tree
case 0:
case 2:
{
tvbuff_t *packet = tvb_new_subset(tvb, offset, attribute_length_byte, attribute_length_byte);
tvbuff_t *packet = tvb_new_subset_length_caplen(tvb, offset, attribute_length_byte, attribute_length_byte);
proto_tree *attribute_tree;
ti = proto_tree_add_item(tree, hf_oid_attribute_oid, tvb, offset, -1, ENC_NA);
@ -5672,7 +5672,7 @@ static int dissect_tunnel_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
opcode = tvb_get_guint8(tvb, offset + 3);
if (opcode == 3)
{
tvbuff_t *next_tvb = tvb_new_subset(tvb, offset + 5, -1, -1);
tvbuff_t *next_tvb = tvb_new_subset_length_caplen(tvb, offset + 5, -1, -1);
dissect_dof_common(next_tvb, pinfo, tree, &ref->api_data);
}
@ -6097,7 +6097,7 @@ static int dissect_dof_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* multiple DPS packets in a single Wireshark frame.
*/
{
tvbuff_t *next_tvb = tvb_new_subset(tvb, offset, packet_length, packet_length);
tvbuff_t *next_tvb = tvb_new_subset_length_caplen(tvb, offset, packet_length, packet_length);
tcp_dof_packet_ref *ref;
gint raw_offset = tvb_raw_offset(tvb) + offset;
gboolean ref_is_new = FALSE;
@ -6324,7 +6324,7 @@ static int dissect_tunnel_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
* multiple DPS packets in a single Wireshark frame.
*/
{
tvbuff_t *next_tvb = tvb_new_subset(tvb, offset, packet_length, packet_length);
tvbuff_t *next_tvb = tvb_new_subset_length_caplen(tvb, offset, packet_length, packet_length);
tcp_dof_packet_ref *ref;
gint raw_offset = tvb_raw_offset(tvb) + offset;
gboolean ref_is_new = FALSE;
@ -6678,7 +6678,7 @@ static int dissect_dnp_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
/* We have a packet. */
{
tvbuff_t *next_tvb = tvb_new_subset(tvb, offset, encapsulated_length, tvb_reported_length(tvb) - offset);
tvbuff_t *next_tvb = tvb_new_subset_length_caplen(tvb, offset, encapsulated_length, tvb_reported_length(tvb) - offset);
offset += dof_dissect_dpp_common(next_tvb, pinfo, proto_item_get_parent(tree), data);
}
}
@ -6819,7 +6819,7 @@ static int dissect_dpp_v2_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
oid_tree = proto_tree_add_subtree(opid_tree, tvb, offset, 0, ett_2009_12_dpp_2_opid, NULL, "Source Identifier");
next_tvb = tvb_new_subset(tvb, offset, -1, tvb_reported_length(tvb) - offset);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, tvb_reported_length(tvb) - offset);
opid_len = call_dissector_only(dof_oid_handle, next_tvb, pinfo, oid_tree, NULL);
learn_sender_sid(api_data, opid_len, tvb_get_ptr(next_tvb, 0, opid_len));
@ -7004,7 +7004,7 @@ static int dissect_dpp_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
oid_tree = proto_tree_add_subtree(opid_tree, tvb, offset, 0, ett_2009_12_dpp_2_opid, NULL, "Source Identifier");
next_tvb = tvb_new_subset(tvb, offset, -1, tvb_reported_length(tvb) - offset);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, tvb_reported_length(tvb) - offset);
opid_len = call_dissector_only(dof_oid_handle, next_tvb, pinfo, oid_tree, NULL);
proto_item_set_len(oid_tree, opid_len);
@ -7364,7 +7364,7 @@ static int dissect_dpp_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
*/
{
guint16 app;
tvbuff_t *next_tvb = tvb_new_subset(tvb, offset, -1, tvb_reported_length(tvb) - offset);
tvbuff_t *next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, tvb_reported_length(tvb) - offset);
read_c2(tvb, offset, &app, NULL);
if (app == 0x7FFF)
@ -7388,7 +7388,7 @@ static int dissect_options(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto
while (offset < (gint)tvb_captured_length(tvb))
{
proto_tree *subtree = proto_tree_add_subtree(tree, tvb, offset, 0, ett_2008_1_dsp_12_option, NULL, "Option");
tvbuff_t *next_tvb = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
gint len = dissect_2008_1_dsp_1(next_tvb, pinfo, subtree);
proto_item_set_len(proto_tree_get_parent(subtree), len);
offset += len;
@ -7976,7 +7976,7 @@ static int dissect_ccm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
* buffer we need to adjust the length of the existing buffer.
*/
g_free(buf);
app = tvb_new_subset(tvb, offset, e_len - session->mac_len, e_len - session->mac_len);
app = tvb_new_subset_length_caplen(tvb, offset, e_len - session->mac_len, e_len - session->mac_len);
dof_packet->decrypted_tvb = app;
dof_packet->decrypted_offset = 0;
}
@ -8844,7 +8844,7 @@ static int dissect_sgmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
offset = dof_dissect_pdu_as_field(dissect_2008_16_security_9, tvb, pinfo, sgmp_tree,
offset, hf_initial_state, ett_initial_state, NULL);
#if 0 /*TODO check this */
initial_state = tvb_new_subset(tvb, start_offset, offset - start_offset, offset - start_offset);
initial_state = tvb_new_subset_length_caplen(tvb, start_offset, offset - start_offset, offset - start_offset);
#endif
}
@ -8994,7 +8994,7 @@ static int dissect_sgmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
offset = dof_dissect_pdu_as_field(dissect_2008_16_security_9, tvb, pinfo, sgmp_tree,
offset, hf_initial_state, ett_initial_state, NULL);
#if 0 /*TODO check this */
initial_state = tvb_new_subset(tvb, start_offset, offset - start_offset, offset - start_offset);
initial_state = tvb_new_subset_length_caplen(tvb, start_offset, offset - start_offset, offset - start_offset);
#endif
}
@ -9197,7 +9197,7 @@ static int dissect_sgmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
{
dof_secmode_api_data setup_data;
gint block_length;
tvbuff_t *ntvb = tvb_new_subset(tvb, A_offset, -1, -1);
tvbuff_t *ntvb = tvb_new_subset_length_caplen(tvb, A_offset, -1, -1);
setup_data.context = INITIALIZE;
setup_data.security_mode_offset = 0;
@ -9300,7 +9300,7 @@ static int dissect_2008_4_tep_2_2_1(tvbuff_t *tvb, packet_info *pinfo, proto_tre
/* Initial State */
{
int block_length;
tvbuff_t *start = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *start = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
ti = proto_tree_add_item(tree, hf_tep_2_2_1_initial_state, tvb, offset, 0, ENC_NA);
ti = proto_item_add_subtree(ti, ett_tep_2_2_1_initial_state);
block_length = dof_dissect_pdu(dissect_2008_16_security_9, start, pinfo, ti, NULL);
@ -9585,7 +9585,7 @@ static int dissect_tep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
if (rekey_data && rekey_data->is_rekey)
{
int block_length;
tvbuff_t *start = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *start = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
ti = proto_tree_add_item(tep_tree, hf_tep_2_2_responder_initialization, tvb, offset, 0, ENC_NA);
ti = proto_item_add_subtree(ti, ett_tep_2_2_responder_initialization);
block_length = dissect_2008_4_tep_2_2_1(start, pinfo, ti, &ssid, data);
@ -12598,7 +12598,7 @@ static void dof_packet_delete_proto_data(dof_packet_data *packet, int proto)
static gint dof_dissect_pdu_as_field(dissector_t dissector, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int item, int ett, void *result)
{
int block_length;
tvbuff_t *start = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *start = tvb_new_subset_length_caplen(tvb, offset, -1, -1);
proto_tree *my_tree;
proto_item *ti = proto_tree_add_item(tree, item, tvb, offset, -1, ENC_NA);
my_tree = proto_item_add_subtree(ti, ett);

View File

@ -117,7 +117,7 @@ dissect_e100(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
} /* if(tree) */
bytes_captured = tvb_get_ntohl(tvb, e100_bytes_cap.offset);
bytes_original = tvb_get_ntohl(tvb, e100_bytes_orig.offset);
next_tvb = tvb_new_subset(tvb, e100_encap_len, bytes_captured, bytes_original);
next_tvb = tvb_new_subset_length_caplen(tvb, e100_encap_len, bytes_captured, bytes_original);
call_dissector(eth_handle, next_tvb, pinfo, tree);
return tvb_captured_length(tvb);

View File

@ -1182,7 +1182,7 @@ dissect_eap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
pinfo->fragmented = save_fragmented;
} else { /* this data is NOT fragmented */
next_tvb = tvb_new_subset(tvb, offset, tvb_len, size);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_len, size);
call_dissector(ssl_handle, next_tvb, pinfo, eap_tree);
}
}

View File

@ -1076,7 +1076,7 @@ dissect_eigrp_metric_flags (proto_tree *tree, tvbuff_t *tvb, int offset, int lim
/* Decode the route flags field */
sub_tree = proto_tree_add_subtree(tree, tvb, offset, limit, ett_eigrp_metric_flags, NULL, "Flags");
sub_tvb = tvb_new_subset(tvb, offset, limit, -1);
sub_tvb = tvb_new_subset_length_caplen(tvb, offset, limit, -1);
/* just care about 'flags' byte, there are no MP flags for now */
proto_tree_add_item(sub_tree, hf_eigrp_metric_flags_srcwd, sub_tvb, 0, 1,
@ -1297,7 +1297,7 @@ dissect_eigrp_services (proto_item *ti, proto_tree *tree, tvbuff_t *tvb,
remaining = tvb_captured_length_remaining(tvb, offset);
sub_tree = proto_tree_add_subtree(tree, tvb, offset, remaining, ett_eigrp_tlv_metric, &sub_ti, "SAF Service ");
sub_tvb = tvb_new_subset(tvb, offset, remaining, -1);
sub_tvb = tvb_new_subset_length_caplen(tvb, offset, remaining, -1);
sub_offset = 0;
for (; tvb_reported_length_remaining(sub_tvb, sub_offset) > 0; ) {
@ -1332,7 +1332,7 @@ dissect_eigrp_services (proto_item *ti, proto_tree *tree, tvbuff_t *tvb,
*/
reach_tree = proto_tree_add_subtree(sub_tree, sub_tvb, sub_offset, 22,
ett_eigrp_saf_reachability, NULL, "Reachability");
reach_tvb = tvb_new_subset(sub_tvb, sub_offset, 22, -1);
reach_tvb = tvb_new_subset_length_caplen(sub_tvb, sub_offset, 22, -1);
afi = tvb_get_ntohs(reach_tvb, 0);
proto_tree_add_item(reach_tree, hf_eigrp_saf_reachability_afi,
@ -1427,7 +1427,7 @@ dissect_eigrp_legacy_metric (proto_tree *tree, tvbuff_t *tvb, int offset)
tvbuff_t *sub_tvb;
sub_tree = proto_tree_add_subtree(tree, tvb, offset, 16, ett_eigrp_tlv_metric, NULL, "Legacy Metric");
sub_tvb = tvb_new_subset(tvb, offset, 16, -1);
sub_tvb = tvb_new_subset_length_caplen(tvb, offset, 16, -1);
proto_tree_add_item(sub_tree, hf_eigrp_legacy_metric_delay, sub_tvb,
0, 4, ENC_BIG_ENDIAN);
@ -1488,7 +1488,7 @@ dissect_eigrp_ipx_extdata (proto_tree *tree, tvbuff_t *tvb, int offset)
int sub_offset = 0;
sub_tree = proto_tree_add_subtree(tree, tvb, offset, 20, ett_eigrp_tlv_extdata, NULL, "External Data");
sub_tvb = tvb_new_subset(tvb, offset, 20, -1);
sub_tvb = tvb_new_subset_length_caplen(tvb, offset, 20, -1);
/* Decode the external route source info */
proto_tree_add_item(sub_tree, hf_eigrp_ipx_extdata_routerid, sub_tvb,
@ -1555,7 +1555,7 @@ dissect_eigrp_extdata (proto_tree *tree, tvbuff_t *tvb, int offset)
int sub_offset = 0;
sub_tree = proto_tree_add_subtree(tree, tvb, offset, 20, ett_eigrp_tlv_extdata, NULL, "External Data");
sub_tvb = tvb_new_subset(tvb, offset, 20, -1);
sub_tvb = tvb_new_subset_length_caplen(tvb, offset, 20, -1);
/* Decode the external route source info */
proto_tree_add_item(sub_tree, hf_eigrp_extdata_origrid, sub_tvb,
@ -2145,7 +2145,7 @@ dissect_eigrp_wide_metric_attr (proto_tree *tree, tvbuff_t *tvb,
limit *= 2; /* words to bytes */
sub_tree = proto_tree_add_subtree(tree, tvb, offset, limit, ett_eigrp_tlv_attr, NULL, "Attributes");
sub_tvb = tvb_new_subset(tvb, offset, limit, -1);
sub_tvb = tvb_new_subset_length_caplen(tvb, offset, limit, -1);
sub_offset = 0;
while (limit > 0) {
@ -2175,7 +2175,7 @@ dissect_eigrp_wide_metric_attr (proto_tree *tree, tvbuff_t *tvb,
case EIGRP_ATTR_COMM:
dissect_eigrp_metric_comm(sub_tree,
tvb_new_subset(sub_tvb, sub_offset, 8, -1),
tvb_new_subset_length_caplen(sub_tvb, sub_offset, 8, -1),
sub_offset, limit);
break;
@ -2247,7 +2247,7 @@ dissect_eigrp_wide_metric (proto_tree *tree, tvbuff_t *tvb, int offset)
guint64 big_num;
sub_tree = proto_tree_add_subtree(tree, tvb, offset, 24, ett_eigrp_tlv_metric, NULL, "Wide Metric");
sub_tvb = tvb_new_subset(tvb, offset, 24, -1);
sub_tvb = tvb_new_subset_length_caplen(tvb, offset, 24, -1);
attr_size = tvb_get_guint8(sub_tvb, 0);

View File

@ -2259,7 +2259,7 @@ dissect_epl_asnd(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, guint8
size = tvb_captured_length_remaining(tvb, offset);
reported_len = tvb_reported_length_remaining(tvb, offset);
next_tvb = tvb_new_subset(tvb, offset, size, reported_len);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, size, reported_len);
/* Manufacturer specific entries for ASND services */
if ( svid >= 0xA0 && svid < 0xFF )
{

View File

@ -499,7 +499,7 @@ static int dissect_erldp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
break;
case VERSION_MAGIC:
next_tvb = tvb_new_subset(tvb, offset, -1, 4 + msg_len - offset);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, 4 + msg_len - offset);
offset += dissect_etf_pdu(next_tvb, pinfo, erldp_tree, "DistributionHeader");
if ((tvb_get_guint8(tvb, offset) == SMALL_TUPLE_EXT) && (tvb_get_guint8(tvb, offset + 2) == SMALL_INTEGER_EXT)) {
ctl_op = tvb_get_guint8(tvb, offset + 3);

View File

@ -721,7 +721,7 @@ add_ethernet_trailer(packet_info *pinfo, proto_tree *tree, proto_tree *fh_tree,
/* Create a new tvb without the padding and/or the (assumed) fcs */
if (fcs_len==4)
real_trailer_tvb = tvb_new_subset(trailer_tvb, padding_length,
real_trailer_tvb = tvb_new_subset_length_caplen(trailer_tvb, padding_length,
trailer_length, trailer_reported_length);
else
real_trailer_tvb = tvb_new_subset_remaining(trailer_tvb, padding_length);
@ -788,7 +788,7 @@ dissect_eth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
total_trailer_length = eth_trailer_length + (eth_assume_fcs ? 4 : 0);
/* Dissect the tvb up to, but not including the trailer */
next_tvb = tvb_new_subset(tvb, 0,
next_tvb = tvb_new_subset_length_caplen(tvb, 0,
tvb_captured_length(tvb) - total_trailer_length,
tvb_reported_length(tvb) - total_trailer_length);
fh_tree = dissect_eth_common(next_tvb, pinfo, tree, 0);

View File

@ -251,7 +251,7 @@ dissect_ethertype(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
captured_length = reported_length;
}
}
next_tvb = tvb_new_subset(tvb, ethertype_data->offset_after_ethertype, captured_length,
next_tvb = tvb_new_subset_length_caplen(tvb, ethertype_data->offset_after_ethertype, captured_length,
reported_length);
p_add_proto_data(pinfo->pool, pinfo, proto_ethertype, 0, GUINT_TO_POINTER((guint)ethertype_data->etype));

View File

@ -162,7 +162,7 @@ dissect_fcoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
bytes_remaining = tvb_captured_length_remaining(tvb, header_len);
if (bytes_remaining > frame_len)
bytes_remaining = frame_len; /* backing length */
next_tvb = tvb_new_subset(tvb, header_len, bytes_remaining, frame_len);
next_tvb = tvb_new_subset_length_caplen(tvb, header_len, bytes_remaining, frame_len);
eof_str = "none";
if (tvb_bytes_exist(tvb, eof_offset, 1)) {

View File

@ -546,7 +546,7 @@ dissect_fcp_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, prot
if (rsplen) {
tvbuff_t *rspinfo_tvb;
rspinfo_tvb = tvb_new_subset(tvb, offset, MIN(rsplen, tvb_captured_length_remaining(tvb, offset)), rsplen);
rspinfo_tvb = tvb_new_subset_length_caplen(tvb, offset, MIN(rsplen, tvb_captured_length_remaining(tvb, offset)), rsplen);
dissect_fcp_rspinfo(rspinfo_tvb, tree, 0);
offset += rsplen;
@ -556,7 +556,7 @@ dissect_fcp_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, prot
if (snslen) {
tvbuff_t *sns_tvb;
sns_tvb = tvb_new_subset(tvb, offset, MIN(snslen, tvb_captured_length_remaining(tvb, offset)), snslen);
sns_tvb = tvb_new_subset_length_caplen(tvb, offset, MIN(snslen, tvb_captured_length_remaining(tvb, offset)), snslen);
dissect_scsi_snsinfo(sns_tvb, pinfo, parent_tree, 0,
snslen,
(request_data != NULL) ? request_data->itlq : &empty_itlq, &itl);

View File

@ -440,7 +440,7 @@ dissect_fip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
if (!tvb_bytes_exist(tvb, desc_offset, dlen) || dlen > rlen) {
break;
}
desc_tvb = tvb_new_subset(tvb, desc_offset, dlen, -1);
desc_tvb = tvb_new_subset_length_caplen(tvb, desc_offset, dlen, -1);
dtype = tvb_get_guint8(desc_tvb, 0);
desc_offset += dlen;
rlen -= dlen;
@ -493,7 +493,7 @@ dissect_fip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
fc_data_t fc_data = {ETHERTYPE_FIP, 0};
subtree = fip_desc_type_len(fip_tree, desc_tvb, dtype, ett_fip_dt_caps, &item);
ls_tvb = tvb_new_subset(desc_tvb, 4, dlen - 4, -1);
ls_tvb = tvb_new_subset_length_caplen(desc_tvb, 4, dlen - 4, -1);
call_dissector_with_data(fc_handle, ls_tvb, pinfo, subtree, &fc_data);
proto_item_append_text(item, "%u bytes", dlen - 4);
}

View File

@ -200,7 +200,7 @@ dissect_gsm_um(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _
len_left = tvb_reported_length(tvb);
len_byte = tvb_get_guint8(tvb, 0);
pseudo_len = len_byte >> 2;
next_tvb = tvb_new_subset(tvb, 1, MIN(len_left, pseudo_len), -1);
next_tvb = tvb_new_subset_length_caplen(tvb, 1, MIN(len_left, pseudo_len), -1);
if (tree) {
proto_tree_add_uint(gsm_um_tree, hf_gsm_um_l2_pseudo_len, tvb, 0, 1,

View File

@ -4346,7 +4346,7 @@ dissect_complete_request_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
offset += 1;
/* Add the Complete Request Message */
new_tvb = tvb_new_subset(tvb, offset, length-1, length-1);
new_tvb = tvb_new_subset_length_caplen(tvb, offset, length-1, length-1);
call_dissector(nas_eps_handle, new_tvb, pinfo, tree);
}

View File

@ -1063,7 +1063,7 @@ dissect_mux_pdu( tvbuff_t *tvb, packet_info *pinfo, guint32 pkt_offset,
}
if(mpl > 0) {
pdu_tvb = tvb_new_subset(tvb, offset, len, mpl);
pdu_tvb = tvb_new_subset_length_caplen(tvb, offset, len, mpl);
if(errors != -1) {
dissect_mux_payload(pdu_tvb,pinfo,pkt_offset+offset,pdu_tree,call_info,mc,end_of_mux_sdu, ctype, circuit_id);
} else {

View File

@ -3900,7 +3900,7 @@ dissect_h225_GenericIdentifier(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *ac
if (gefx) {
ti = proto_tree_add_string(tree, hf_h225_debug_dissector_try_string, tvb, offset>>3, 0, gefx->key);
PROTO_ITEM_SET_HIDDEN(ti);
dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset(tvb, offset>>3, 0, 0), actx->pinfo, tree, actx);
dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset_length_caplen(tvb, offset>>3, 0, 0), actx->pinfo, tree, actx);
}
actx->private_data = gefx; /* subdissector could overwrite it */

View File

@ -3641,7 +3641,7 @@ dissect_h245_CapabilityIdentifier(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
if (gefx) {
ti = proto_tree_add_string(tree, hf_h245_debug_dissector_try_string, tvb, offset>>3, 0, gefx->key);
PROTO_ITEM_SET_HIDDEN(ti);
dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset(tvb, offset>>3, 0, 0), actx->pinfo, tree, actx);
dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset_length_caplen(tvb, offset>>3, 0, 0), actx->pinfo, tree, actx);
}
actx->private_data = gefx; /* subdissector could overwrite it */
@ -3709,7 +3709,7 @@ dissect_h245_ParameterIdentifier(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *
if (gefx) {
ti = proto_tree_add_string(tree, hf_h245_debug_dissector_try_string, tvb, offset>>3, 0, gefx->key);
PROTO_ITEM_SET_HIDDEN(ti);
dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset(tvb, offset>>3, 0, 0), actx->pinfo, tree, actx);
dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset_length_caplen(tvb, offset>>3, 0, 0), actx->pinfo, tree, actx);
}
actx->private_data = gefx; /* subdissector could overwrite it */

View File

@ -2116,7 +2116,7 @@ dissect_h264_pacsi(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint off
else
{
/* Make a new subset of the existing buffer for the NAL unit */
nalu_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb,offset), nal_unit_size);
nalu_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_captured_length_remaining(tvb,offset), nal_unit_size);
/* Decode the NAL unit */
dissect_h264(nalu_tvb, pinfo, tree, NULL);
offset += nal_unit_size;
@ -2165,7 +2165,7 @@ dissect_h264_stap(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint
else
{
/* Make a new subset of the existing buffer for the NAL unit */
nalu_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), nal_unit_size);
nalu_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_captured_length_remaining(tvb, offset), nal_unit_size);
/* Decode the NAL unit */
dissect_h264(nalu_tvb, pinfo, tree, NULL);
offset += nal_unit_size;
@ -2222,7 +2222,7 @@ dissect_h264_mtap(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint
else
{
/* Make a new subset of the existing buffer for the NAL unit */
nalu_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), nal_unit_size);
nalu_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_captured_length_remaining(tvb, offset), nal_unit_size);
/* Decode the NAL unit */
dissect_h264(nalu_tvb, pinfo, tree, NULL);
offset += nal_unit_size;
@ -2288,7 +2288,7 @@ dissect_h264_nalu_extension (proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo
else
{
/* Make a new subset of the existing buffer for the NAL unit */
nalu_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), nal_unit_size);
nalu_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_captured_length_remaining(tvb, offset), nal_unit_size);
/* Decode the NAL unit */
dissect_h264(nalu_tvb, pinfo, nimtap_tree, NULL);
offset += nal_unit_size;

View File

@ -246,7 +246,7 @@ dissect_h450_ros_Invoke(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
if (!arg_next_tvb) { /* empty argument */
arg_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
arg_next_tvb = tvb_new_subset_length_caplen(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
}
call_dissector_with_data((arg_handle)?arg_handle:data_handle, arg_next_tvb, actx->pinfo, tree, actx->rose_ctx);
@ -330,7 +330,7 @@ dissect_h450_ros_ReturnResult(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *act
if (actx->rose_ctx->d.code != -1) {
if (!res_next_tvb) { /* empty result */
res_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
res_next_tvb = tvb_new_subset_length_caplen(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
}
call_dissector_with_data((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree, actx->rose_ctx);
@ -399,7 +399,7 @@ dissect_h450_ros_ReturnError(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
if (!err_next_tvb) { /* empty error */
err_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
err_next_tvb = tvb_new_subset_length_caplen(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
}
call_dissector_with_data((err_handle)?err_handle:data_handle, err_next_tvb, actx->pinfo, tree, actx->rose_ctx);

View File

@ -1109,7 +1109,7 @@ dissect_hiqnet_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
if (captured_length > plen)
captured_length = plen;
next_tvb = tvb_new_subset(tvb, offset, captured_length, plen);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, captured_length, plen);
dissect_hiqnet_pdu(next_tvb, pinfo, tree, data);

View File

@ -1382,7 +1382,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
* which, if no content length was specified,
* is -1, i.e. "to the end of the frame.
*/
next_tvb = tvb_new_subset(tvb, offset, datalen,
next_tvb = tvb_new_subset_length_caplen(tvb, offset, datalen,
reported_datalen);
/*
@ -1854,7 +1854,7 @@ chunked_encoding_dissector(tvbuff_t **tvb_ptr, packet_info *pinfo,
if (new_tvb != NULL && chunk_size != 0) {
tvbuff_t *chunk_tvb = NULL;
chunk_tvb = tvb_new_subset(tvb, chunk_offset,
chunk_tvb = tvb_new_subset_length_caplen(tvb, chunk_offset,
chunk_size, datalen);
tvb_composite_append(new_tvb, chunk_tvb);

View File

@ -1464,7 +1464,7 @@ static int dissect_iec104apci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
proto_item_append_text(it104, ": %s", wmem_strbuf_get_str(res));
if (type == I_TYPE)
call_dissector(iec104asdu_handle, tvb_new_subset(tvb, Off + APCI_LEN, -1, len - APCI_DATA_LEN), pinfo, tree);
call_dissector(iec104asdu_handle, tvb_new_subset_length_caplen(tvb, Off + APCI_LEN, -1, len - APCI_DATA_LEN), pinfo, tree);
/* Don't search more the APCI_START */
break;

View File

@ -17968,7 +17968,7 @@ dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo,
item=proto_tree_add_uint(hdr_tree, hf_ieee80211_fc_analysis_retransmission_frame, tvb, 0, 0, fnum);
PROTO_ITEM_SET_GENERATED(item);
}
next_tvb = tvb_new_subset(tvb, hdr_len, len, reported_len);
next_tvb = tvb_new_subset_length_caplen(tvb, hdr_len, len, reported_len);
call_data_dissector(next_tvb, pinfo, tree);
goto end_of_wlan;
}
@ -18195,7 +18195,7 @@ dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo,
* WEP decode impossible or failed, treat payload as raw data
* and don't attempt fragment reassembly or further dissection.
*/
next_tvb = tvb_new_subset(tvb, hdr_len + ivlen, len, reported_len);
next_tvb = tvb_new_subset_length_caplen(tvb, hdr_len + ivlen, len, reported_len);
if (tree) {
if (algorithm == PROTECTION_ALG_WEP) {
@ -18312,7 +18312,7 @@ dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo,
/* First fragment, or not fragmented. Dissect what we have here. */
/* Get a tvbuff for the payload. */
next_tvb = tvb_new_subset(next_tvb, hdr_len, len, reported_len);
next_tvb = tvb_new_subset_length_caplen(next_tvb, hdr_len, len, reported_len);
/*
* If this is the first fragment, but not the only fragment,
@ -18328,7 +18328,7 @@ dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo,
if (next_tvb == NULL) {
/* Just show this as an incomplete fragment. */
col_set_str(pinfo->cinfo, COL_INFO, "Fragmented IEEE 802.11 frame");
next_tvb = tvb_new_subset(tvb, hdr_len, len, reported_len);
next_tvb = tvb_new_subset_length_caplen(tvb, hdr_len, len, reported_len);
call_data_dissector(next_tvb, pinfo, tree);
pinfo->fragmented = save_fragmented;
goto end_of_wlan;

View File

@ -807,7 +807,7 @@ dissect_ieee802154_nonask_phy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
}
offset+=4+2*1;
mac=tvb_new_subset(tvb,offset,-1, phr & IEEE802154_PHY_LENGTH_MASK);
mac=tvb_new_subset_length_caplen(tvb,offset,-1, phr & IEEE802154_PHY_LENGTH_MASK);
/* Call the common dissector. */
dissect_ieee802154(mac, pinfo, ieee802154_tree, NULL);
@ -862,7 +862,7 @@ dissect_ieee802154_nofcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
* checks to ensure that the new reported length is not longer than the old
* reported length (why?), and will throw an exception.
*/
new_tvb = tvb_new_subset(tvb, 0, -1, tvb_reported_length(tvb)+IEEE802154_FCS_LEN);
new_tvb = tvb_new_subset_length_caplen(tvb, 0, -1, tvb_reported_length(tvb)+IEEE802154_FCS_LEN);
/* Call the common dissector. */
dissect_ieee802154_common(new_tvb, pinfo, tree, 0);
return tvb_captured_length(tvb);
@ -906,7 +906,7 @@ dissect_zboss_specific(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
proto_tree_add_item(zboss_tree, zboss_trace_number, tvb, off, 4, ENC_LITTLE_ENDIAN);
off += 4;
return tvb_new_subset(tvb, off, tvb_captured_length(tvb) - off, tvb_captured_length(tvb) - off);
return tvb_new_subset_length_caplen(tvb, off, tvb_captured_length(tvb) - off, tvb_captured_length(tvb) - off);
}
}
return tvb;
@ -1518,7 +1518,7 @@ dissect_ieee802154_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
gint reported_len = tvb_reported_length(tvb)-offset-IEEE802154_FCS_LEN;
gint captured_len = tvb_captured_length(tvb)-offset;
if (reported_len < captured_len) captured_len = reported_len;
payload_tvb = tvb_new_subset(tvb, offset, captured_len, reported_len);
payload_tvb = tvb_new_subset_length_caplen(tvb, offset, captured_len, reported_len);
}
/* Display the reason for failure, and abort if the error was fatal. */
@ -1573,7 +1573,7 @@ dissect_ieee802154_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
gint reported_len = tvb_reported_length(tvb)-offset-IEEE802154_FCS_LEN;
gint captured_len = tvb_captured_length(tvb)-offset;
if (reported_len < captured_len) captured_len = reported_len;
payload_tvb = tvb_new_subset(tvb, offset, captured_len, reported_len);
payload_tvb = tvb_new_subset_length_caplen(tvb, offset, captured_len, reported_len);
}
/* presense of Payload IEs is defined by the termination of the Header IEs */
@ -3060,7 +3060,7 @@ dissect_ieee802154_decrypt(tvbuff_t *tvb, guint offset, packet_info *pinfo, ieee
}
/* Create a tvbuff for the plaintext. This might result in a zero-length tvbuff. */
ptext_tvb = tvb_new_subset(tvb, offset, captured_len, reported_len);
ptext_tvb = tvb_new_subset_length_caplen(tvb, offset, captured_len, reported_len);
*status = DECRYPT_PACKET_SUCCEEDED;
}

View File

@ -78,7 +78,7 @@ dissect_802_3(volatile int length, gboolean is_802_2, tvbuff_t *tvb,
captured_length = tvb_captured_length_remaining(tvb, offset_after_length);
if (captured_length > length)
captured_length = length;
next_tvb = tvb_new_subset(tvb, offset_after_length, captured_length, length);
next_tvb = tvb_new_subset_length_caplen(tvb, offset_after_length, captured_length, length);
/* Dissect the payload either as IPX or as an LLC frame.
Catch non-fatal exceptions, so that if the reported length

View File

@ -126,7 +126,7 @@ static int dissect_igrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
ti = proto_tree_add_item(igrp_tree, hf_igrp_interior_routes, tvb, 4, 2, ENC_BIG_ENDIAN);
for( ; ninterior>0 ; ninterior-- ) {
igrp_vektor_tree = proto_item_add_subtree(ti,ett_igrp_vektor);
next_tvb = tvb_new_subset(tvb, offset, IGRP_ENTRY_LENGTH, -1);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, IGRP_ENTRY_LENGTH, -1);
dissect_vektor_igrp (next_tvb,igrp_vektor_tree,network);
offset+=IGRP_ENTRY_LENGTH;
}
@ -134,7 +134,7 @@ static int dissect_igrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
ti = proto_tree_add_item(igrp_tree, hf_igrp_system_routes, tvb, 6, 2, ENC_BIG_ENDIAN);
for( ; nsystem>0 ; nsystem-- ) {
igrp_vektor_tree = proto_item_add_subtree(ti,ett_igrp_vektor);
next_tvb = tvb_new_subset(tvb, offset, IGRP_ENTRY_LENGTH, -1);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, IGRP_ENTRY_LENGTH, -1);
dissect_vektor_igrp (next_tvb,igrp_vektor_tree,0);
offset+=IGRP_ENTRY_LENGTH;
}
@ -142,7 +142,7 @@ static int dissect_igrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
ti = proto_tree_add_item(igrp_tree, hf_igrp_exterior_routes, tvb, 8, 2, ENC_BIG_ENDIAN);
for( ; nexterior>0 ; nexterior-- ) {
igrp_vektor_tree = proto_item_add_subtree(ti,ett_igrp_vektor);
next_tvb = tvb_new_subset(tvb, offset, IGRP_ENTRY_LENGTH, -1);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, IGRP_ENTRY_LENGTH, -1);
dissect_vektor_igrp (next_tvb,igrp_vektor_tree,0);
offset+=IGRP_ENTRY_LENGTH;
}

View File

@ -222,7 +222,7 @@ dissect_ipmi_session(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
}
/* If we can parse the embedded message, do so */
next_tvb = tvb_new_subset(tvb, msg_start, msg_len, -1);
next_tvb = tvb_new_subset_length_caplen(tvb, msg_start, msg_len, -1);
if (payloadtype_enc) {
/* This is RMCP+, and payload is encrypted. In this case,
there is a 'confidentiality header/trailer', whose lengths

View File

@ -147,7 +147,7 @@ dissect_tcpencap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
}
/* Create the tvbuffer for the next dissector */
next_tvb = tvb_new_subset(tvb, 0, reported_length - TRAILERLENGTH , -1);
next_tvb = tvb_new_subset_length_caplen(tvb, 0, reported_length - TRAILERLENGTH , -1);
if (protocol == TCP_ENCAP_P_UDP) {
call_dissector(udp_handle, next_tvb, pinfo, tree);
} else { /* Hopefully ESP */

View File

@ -2103,7 +2103,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
*/
if(!g_esp_enable_encryption_decode && g_esp_enable_authentication_check && sad_is_present)
{
next_tvb = tvb_new_subset(tvb, 8, len - 8 - esp_auth_len, -1);
next_tvb = tvb_new_subset_length_caplen(tvb, 8, len - 8 - esp_auth_len, -1);
export_ipsec_pdu(data_handle, pinfo, next_tvb);
call_dissector(data_handle, next_tvb, pinfo, esp_tree);

View File

@ -1532,7 +1532,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
tvb_rlen=tvb_reported_length_remaining(tvb, offset);
if(tvb_rlen>snsl)
tvb_rlen=snsl;
data_tvb=tvb_new_subset(tvb, offset, tvb_len, tvb_rlen);
data_tvb=tvb_new_subset_length_caplen(tvb, offset, tvb_len, tvb_rlen);
dissect_scsi_snsinfo (data_tvb, pinfo, tree, 0,
tvb_len,
&cdata->itlq, itl);
@ -1672,7 +1672,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
if(tvb_rlen>16){
tvb_rlen=16;
}
cdb_tvb=tvb_new_subset(tvb, cdb_offset, tvb_len, tvb_rlen);
cdb_tvb=tvb_new_subset_length_caplen(tvb, cdb_offset, tvb_len, tvb_rlen);
}
dissect_scsi_cdb(cdb_tvb, pinfo, tree, SCSI_DEV_UNKNOWN, &cdata->itlq, itl);
/* we don't want the immediate below to overwrite our CDB info */
@ -1687,7 +1687,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
tvb_rlen=tvb_reported_length_remaining(tvb, immediate_data_offset);
if(tvb_rlen>(int)immediate_data_length)
tvb_rlen=immediate_data_length;
data_tvb=tvb_new_subset(tvb, immediate_data_offset, tvb_len, tvb_rlen);
data_tvb=tvb_new_subset_length_caplen(tvb, immediate_data_offset, tvb_len, tvb_rlen);
dissect_scsi_payload (data_tvb, pinfo, tree,
TRUE,
&cdata->itlq, itl,
@ -1713,7 +1713,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
tvb_rlen=tvb_reported_length_remaining(tvb, offset);
if(tvb_rlen>senseLen)
tvb_rlen=senseLen;
data_tvb=tvb_new_subset(tvb, offset, tvb_len, tvb_rlen);
data_tvb=tvb_new_subset_length_caplen(tvb, offset, tvb_len, tvb_rlen);
dissect_scsi_snsinfo (data_tvb, pinfo, tree, 0,
tvb_len,
&cdata->itlq, itl);
@ -1736,7 +1736,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
tvb_rlen=tvb_reported_length_remaining(tvb, offset);
if(tvb_rlen>(int)data_segment_len)
tvb_rlen=data_segment_len;
data_tvb=tvb_new_subset(tvb, offset, tvb_len, tvb_rlen);
data_tvb=tvb_new_subset_length_caplen(tvb, offset, tvb_len, tvb_rlen);
dissect_scsi_payload (data_tvb, pinfo, tree,
(opcode==ISCSI_OPCODE_SCSI_DATA_OUT),
&cdata->itlq, itl,

View File

@ -917,7 +917,7 @@ static int dissect_isi_sim(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitre
proto_tree_add_item(tree, hf_isi_sim_imsi_length, tvb, 3, 1, ENC_BIG_ENDIAN);
/*
next_tvb = tvb_new_subset(tvb, 0, -1, -1);
next_tvb = tvb_new_subset_length_caplen(tvb, 0, -1, -1);
proto_tree_add_item(tree, hf_isi_sim_imsi_byte_1, next_tvb, 4, 1, ENC_LITTLE_ENDIAN);
dissect_e212_mcc_mnc(next_tvb, pinfo, tree, 4, FALSE );
proto_tree_add_item(tree, hf_E212_msin, tvb, 2, 7, FALSE);

View File

@ -202,7 +202,7 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int fcs_len)
the packet doesn't have "length" bytes worth of
captured data left in it - or it may not even have
"length" bytes worth of data in it, period -
so the "tvb_new_subset()" creating "payload_tvb"
so the "tvb_new_subset_length_caplen()" creating "payload_tvb"
threw an exception
or
@ -214,7 +214,7 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int fcs_len)
In either case, this means that all the data in the frame
is within the length value, so we give all the data to the
next protocol and have no trailer. */
payload_tvb = tvb_new_subset(tvb, 14, -1, length);
payload_tvb = tvb_new_subset_length_caplen(tvb, 14, -1, length);
trailer_tvb = NULL;
}
ENDTRY;
@ -263,7 +263,7 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int fcs_len)
if (captured_length > length)
captured_length = length;
next_tvb = tvb_new_subset(payload_tvb, 12, captured_length, length);
next_tvb = tvb_new_subset_length_caplen(payload_tvb, 12, captured_length, length);
/* Dissect the payload as an Ethernet frame.

View File

@ -227,7 +227,7 @@ dissect_iso15765(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
case ISO15765_MESSAGE_TYPES_SINGLE_FRAME: {
offset = ae + ISO15765_PCI_OFFSET + ISO15765_PCI_LEN;
data_length = masked_guint8_value(pci, ISO15765_MESSAGE_DATA_LENGTH_MASK);
next_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, data_length, data_length);
complete = TRUE;
/* Show some info */
@ -366,7 +366,7 @@ dissect_iso15765(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
next_tvb = new_tvb;
complete = TRUE;
} else {
next_tvb = tvb_new_subset(tvb, offset, data_length, data_length);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, data_length, data_length);
}
}
}

View File

@ -7979,7 +7979,7 @@ dissect_isup_optional_parameter(tvbuff_t *optional_parameters_tvb, packet_info *
actual_length = tvb_reported_length_remaining(optional_parameters_tvb, offset);
if (actual_length > 0) {
parameter_tvb = tvb_new_subset(optional_parameters_tvb, offset, MIN(parameter_length, actual_length), parameter_length);
parameter_tvb = tvb_new_subset_length_caplen(optional_parameters_tvb, offset, MIN(parameter_length, actual_length), parameter_length);
switch (parameter_type) {
case PARAM_TYPE_CALL_REF:
dissect_isup_call_reference_parameter(parameter_tvb, parameter_tree, parameter_item);
@ -8336,7 +8336,7 @@ dissect_ansi_isup_optional_parameter(tvbuff_t *optional_parameters_tvb, packet_i
actual_length = tvb_reported_length_remaining(optional_parameters_tvb, offset);
if (actual_length > 0) {
parameter_tvb = tvb_new_subset(optional_parameters_tvb, offset, MIN(parameter_length, actual_length), parameter_length);
parameter_tvb = tvb_new_subset_length_caplen(optional_parameters_tvb, offset, MIN(parameter_length, actual_length), parameter_length);
switch (parameter_type) {
case PARAM_TYPE_CALL_REF:
dissect_isup_call_reference_parameter(parameter_tvb, parameter_tree, parameter_item);
@ -8643,7 +8643,7 @@ dissect_ansi_isup_circuit_validation_test_resp_message(tvbuff_t *message_tvb, pr
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CVR_RESP_IND_LENGTH, actual_length), CVR_RESP_IND_LENGTH);
parameter_tvb = tvb_new_subset_length_caplen(message_tvb, offset, MIN(CVR_RESP_IND_LENGTH, actual_length), CVR_RESP_IND_LENGTH);
dissect_isup_cvr_response_ind_parameter(parameter_tvb, parameter_tree, parameter_item);
offset += CVR_RESP_IND_LENGTH;
@ -8657,7 +8657,7 @@ dissect_ansi_isup_circuit_validation_test_resp_message(tvbuff_t *message_tvb, pr
parameter_type,
val_to_str_ext_const(parameter_type, &isup_parameter_type_value_ext, "Circuit Group Characters"));
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CG_CHAR_IND_LENGTH, actual_length), CG_CHAR_IND_LENGTH);
parameter_tvb = tvb_new_subset_length_caplen(message_tvb, offset, MIN(CG_CHAR_IND_LENGTH, actual_length), CG_CHAR_IND_LENGTH);
dissect_isup_circuit_group_char_ind_parameter(parameter_tvb, parameter_tree, parameter_item);
offset += CG_CHAR_IND_LENGTH;
@ -8682,7 +8682,7 @@ dissect_ansi_isup_circuit_reservation_message(tvbuff_t *message_tvb, proto_tree
"Nature of Connection Indicators");
proto_tree_add_uint(parameter_tree, hf_isup_mand_parameter_type, message_tvb, 0, 0, parameter_type);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(NATURE_OF_CONNECTION_IND_LENGTH, actual_length), NATURE_OF_CONNECTION_IND_LENGTH);
parameter_tvb = tvb_new_subset_length_caplen(message_tvb, offset, MIN(NATURE_OF_CONNECTION_IND_LENGTH, actual_length), NATURE_OF_CONNECTION_IND_LENGTH);
dissect_isup_nature_of_connection_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
offset += NATURE_OF_CONNECTION_IND_LENGTH;
@ -8707,7 +8707,7 @@ dissect_isup_initial_address_message(tvbuff_t *message_tvb, packet_info *pinfo,
"Nature of Connection Indicators");
proto_tree_add_uint(parameter_tree, hf_isup_mand_parameter_type, message_tvb, 0, 0, parameter_type);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(NATURE_OF_CONNECTION_IND_LENGTH, actual_length), NATURE_OF_CONNECTION_IND_LENGTH);
parameter_tvb = tvb_new_subset_length_caplen(message_tvb, offset, MIN(NATURE_OF_CONNECTION_IND_LENGTH, actual_length), NATURE_OF_CONNECTION_IND_LENGTH);
dissect_isup_nature_of_connection_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
offset += NATURE_OF_CONNECTION_IND_LENGTH;
@ -8718,7 +8718,7 @@ dissect_isup_initial_address_message(tvbuff_t *message_tvb, packet_info *pinfo,
"Forward Call Indicators");
proto_tree_add_uint(parameter_tree, hf_isup_mand_parameter_type, message_tvb, 0, 0, parameter_type);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(FORWARD_CALL_IND_LENGTH, actual_length), FORWARD_CALL_IND_LENGTH);
parameter_tvb = tvb_new_subset_length_caplen(message_tvb, offset, MIN(FORWARD_CALL_IND_LENGTH, actual_length), FORWARD_CALL_IND_LENGTH);
dissect_isup_forward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
offset += FORWARD_CALL_IND_LENGTH;
@ -8730,7 +8730,7 @@ dissect_isup_initial_address_message(tvbuff_t *message_tvb, packet_info *pinfo,
"Calling Party's category");
proto_tree_add_uint(parameter_tree, hf_isup_mand_parameter_type, message_tvb, 0, 0, parameter_type);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CALLING_PRTYS_CATEGORY_LENGTH, actual_length), CALLING_PRTYS_CATEGORY_LENGTH);
parameter_tvb = tvb_new_subset_length_caplen(message_tvb, offset, MIN(CALLING_PRTYS_CATEGORY_LENGTH, actual_length), CALLING_PRTYS_CATEGORY_LENGTH);
dissect_isup_calling_partys_category_parameter(parameter_tvb, parameter_tree, parameter_item, itu_isup_variant);
offset += CALLING_PRTYS_CATEGORY_LENGTH;
@ -8744,7 +8744,7 @@ dissect_isup_initial_address_message(tvbuff_t *message_tvb, packet_info *pinfo,
"Transmission medium requirement");
proto_tree_add_uint(parameter_tree, hf_isup_mand_parameter_type, message_tvb, 0, 0, parameter_type);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb,
parameter_tvb = tvb_new_subset_length_caplen(message_tvb,
offset,
MIN(TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH, actual_length),
TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH);
@ -8767,7 +8767,7 @@ dissect_isup_initial_address_message(tvbuff_t *message_tvb, packet_info *pinfo,
proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer,
PARAMETER_LENGTH_IND_LENGTH, parameter_length);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb,
parameter_tvb = tvb_new_subset_length_caplen(message_tvb,
offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH,
MIN(parameter_length, actual_length),
parameter_length);
@ -8792,7 +8792,7 @@ dissect_isup_initial_address_message(tvbuff_t *message_tvb, packet_info *pinfo,
proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer,
PARAMETER_LENGTH_IND_LENGTH, parameter_length);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb,
parameter_tvb = tvb_new_subset_length_caplen(message_tvb,
offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH,
MIN(parameter_length, actual_length),
parameter_length);
@ -8829,7 +8829,7 @@ static gint dissect_isup_subsequent_address_message(tvbuff_t *message_tvb, packe
proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer,
PARAMETER_LENGTH_IND_LENGTH, parameter_length);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb,
parameter_tvb = tvb_new_subset_length_caplen(message_tvb,
offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH,
MIN(parameter_length, actual_length),
parameter_length);
@ -8858,7 +8858,7 @@ dissect_isup_information_request_message(tvbuff_t *message_tvb, proto_tree *isup
"Information request indicators");
proto_tree_add_uint(parameter_tree, hf_isup_mand_parameter_type, message_tvb, 0, 0, parameter_type);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(INFO_REQUEST_IND_LENGTH, actual_length), INFO_REQUEST_IND_LENGTH);
parameter_tvb = tvb_new_subset_length_caplen(message_tvb, offset, MIN(INFO_REQUEST_IND_LENGTH, actual_length), INFO_REQUEST_IND_LENGTH);
dissect_isup_information_request_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
offset += INFO_REQUEST_IND_LENGTH;
return offset;
@ -8883,7 +8883,7 @@ dissect_isup_information_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
"Information indicators");
proto_tree_add_uint(parameter_tree, hf_isup_mand_parameter_type, message_tvb, 0, 0, parameter_type);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(INFO_IND_LENGTH, actual_length), INFO_IND_LENGTH);
parameter_tvb = tvb_new_subset_length_caplen(message_tvb, offset, MIN(INFO_IND_LENGTH, actual_length), INFO_IND_LENGTH);
dissect_isup_information_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
offset += INFO_IND_LENGTH;
return offset;
@ -8907,7 +8907,7 @@ dissect_isup_continuity_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
"Continuity indicators");
proto_tree_add_uint(parameter_tree, hf_isup_mand_parameter_type, message_tvb, 0, 0, parameter_type);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CONTINUITY_IND_LENGTH, actual_length), CONTINUITY_IND_LENGTH);
parameter_tvb = tvb_new_subset_length_caplen(message_tvb, offset, MIN(CONTINUITY_IND_LENGTH, actual_length), CONTINUITY_IND_LENGTH);
dissect_isup_continuity_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
offset += CONTINUITY_IND_LENGTH;
return offset;
@ -8931,7 +8931,7 @@ dissect_isup_address_complete_message(tvbuff_t *message_tvb, proto_tree *isup_tr
"Backward Call Indicators");
proto_tree_add_uint(parameter_tree, hf_isup_mand_parameter_type, message_tvb, 0, 0, parameter_type);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(BACKWARD_CALL_IND_LENGTH, actual_length), BACKWARD_CALL_IND_LENGTH);
parameter_tvb = tvb_new_subset_length_caplen(message_tvb, offset, MIN(BACKWARD_CALL_IND_LENGTH, actual_length), BACKWARD_CALL_IND_LENGTH);
dissect_isup_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
offset += BACKWARD_CALL_IND_LENGTH;
return offset;
@ -8955,7 +8955,7 @@ dissect_isup_connect_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
"Backward Call Indicators");
proto_tree_add_uint(parameter_tree, hf_isup_mand_parameter_type, message_tvb, 0, 0, parameter_type);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(BACKWARD_CALL_IND_LENGTH, actual_length), BACKWARD_CALL_IND_LENGTH);
parameter_tvb = tvb_new_subset_length_caplen(message_tvb, offset, MIN(BACKWARD_CALL_IND_LENGTH, actual_length), BACKWARD_CALL_IND_LENGTH);
dissect_isup_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
offset += BACKWARD_CALL_IND_LENGTH;
return offset;
@ -8989,7 +8989,7 @@ dissect_isup_release_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer,
PARAMETER_LENGTH_IND_LENGTH, parameter_length);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb,
parameter_tvb = tvb_new_subset_length_caplen(message_tvb,
offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH,
MIN(parameter_length, actual_length),
parameter_length);
@ -9025,7 +9025,7 @@ dissect_isup_suspend_resume_message(tvbuff_t *message_tvb, proto_tree *isup_tree
"Suspend/Resume indicator");
proto_tree_add_uint(parameter_tree, hf_isup_mand_parameter_type, message_tvb, 0, 0, parameter_type);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(SUSPEND_RESUME_IND_LENGTH, actual_length), SUSPEND_RESUME_IND_LENGTH);
parameter_tvb = tvb_new_subset_length_caplen(message_tvb, offset, MIN(SUSPEND_RESUME_IND_LENGTH, actual_length), SUSPEND_RESUME_IND_LENGTH);
dissect_isup_suspend_resume_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
offset += SUSPEND_RESUME_IND_LENGTH;
return offset;
@ -9059,7 +9059,7 @@ dissect_isup_circuit_group_reset_query_message(tvbuff_t *message_tvb, packet_inf
proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer,
PARAMETER_LENGTH_IND_LENGTH, parameter_length);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb,
parameter_tvb = tvb_new_subset_length_caplen(message_tvb,
offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH,
MIN(parameter_length, actual_length),
parameter_length);
@ -9088,7 +9088,7 @@ dissect_isup_circuit_group_blocking_messages(tvbuff_t *message_tvb, packet_info
"Circuit group supervision message type");
proto_tree_add_uint(parameter_tree, hf_isup_mand_parameter_type, message_tvb, 0, 0, parameter_type);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CIRC_GRP_SV_MSG_TYPE_LENGTH, actual_length), CIRC_GRP_SV_MSG_TYPE_LENGTH);
parameter_tvb = tvb_new_subset_length_caplen(message_tvb, offset, MIN(CIRC_GRP_SV_MSG_TYPE_LENGTH, actual_length), CIRC_GRP_SV_MSG_TYPE_LENGTH);
dissect_isup_circuit_group_supervision_message_type_parameter(parameter_tvb, parameter_tree, parameter_item);
offset += CIRC_GRP_SV_MSG_TYPE_LENGTH;
@ -9109,7 +9109,7 @@ dissect_isup_circuit_group_blocking_messages(tvbuff_t *message_tvb, packet_info
proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer,
PARAMETER_LENGTH_IND_LENGTH, parameter_length);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb,
parameter_tvb = tvb_new_subset_length_caplen(message_tvb,
offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH,
MIN(parameter_length, actual_length),
parameter_length);
@ -9138,7 +9138,7 @@ dissect_isup_facility_request_accepted_message(tvbuff_t *message_tvb, proto_tree
"Facility indicator");
proto_tree_add_uint(parameter_tree, hf_isup_mand_parameter_type, message_tvb, 0, 0, parameter_type);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(FACILITY_IND_LENGTH, actual_length), FACILITY_IND_LENGTH);
parameter_tvb = tvb_new_subset_length_caplen(message_tvb, offset, MIN(FACILITY_IND_LENGTH, actual_length), FACILITY_IND_LENGTH);
dissect_isup_facility_ind_parameter(parameter_tvb, parameter_item);
offset += FACILITY_IND_LENGTH;
return offset;
@ -9163,7 +9163,7 @@ dissect_isup_facility_reject_message(tvbuff_t *message_tvb, proto_tree *isup_tre
"Facility indicator");
proto_tree_add_uint(parameter_tree, hf_isup_mand_parameter_type, message_tvb, 0, 0, parameter_type);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(FACILITY_IND_LENGTH, actual_length), FACILITY_IND_LENGTH);
parameter_tvb = tvb_new_subset_length_caplen(message_tvb, offset, MIN(FACILITY_IND_LENGTH, actual_length), FACILITY_IND_LENGTH);
dissect_isup_facility_ind_parameter(parameter_tvb, parameter_item);
offset += FACILITY_IND_LENGTH;
@ -9184,7 +9184,7 @@ dissect_isup_facility_reject_message(tvbuff_t *message_tvb, proto_tree *isup_tre
proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer,
PARAMETER_LENGTH_IND_LENGTH, parameter_length);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb,
parameter_tvb = tvb_new_subset_length_caplen(message_tvb,
offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH,
MIN(parameter_length, actual_length),
parameter_length);
@ -9229,7 +9229,7 @@ dissect_isup_circuit_group_reset_acknowledgement_message(tvbuff_t *message_tvb,
proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer,
PARAMETER_LENGTH_IND_LENGTH, parameter_length);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb,
parameter_tvb = tvb_new_subset_length_caplen(message_tvb,
offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH,
MIN(parameter_length, actual_length),
parameter_length);
@ -9267,7 +9267,7 @@ dissect_isup_circuit_group_query_response_message(tvbuff_t *message_tvb, packet_
proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer,
PARAMETER_LENGTH_IND_LENGTH, parameter_length);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb,
parameter_tvb = tvb_new_subset_length_caplen(message_tvb,
offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH,
MIN(parameter_length, actual_length),
parameter_length);
@ -9291,7 +9291,7 @@ dissect_isup_circuit_group_query_response_message(tvbuff_t *message_tvb, packet_
proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer,
PARAMETER_LENGTH_IND_LENGTH, parameter_length);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb,
parameter_tvb = tvb_new_subset_length_caplen(message_tvb,
offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH,
MIN(parameter_length, actual_length),
parameter_length);
@ -9319,7 +9319,7 @@ dissect_isup_call_progress_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
"Event information");
proto_tree_add_uint(parameter_tree, hf_isup_mand_parameter_type, message_tvb, 0, 0, parameter_type);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(EVENT_INFO_LENGTH, actual_length), EVENT_INFO_LENGTH);
parameter_tvb = tvb_new_subset_length_caplen(message_tvb, offset, MIN(EVENT_INFO_LENGTH, actual_length), EVENT_INFO_LENGTH);
dissect_isup_event_information_parameter(parameter_tvb, parameter_tree, parameter_item);
offset += EVENT_INFO_LENGTH;
return offset;
@ -9353,7 +9353,7 @@ dissect_isup_user_to_user_information_message(tvbuff_t *message_tvb, packet_info
proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer,
PARAMETER_LENGTH_IND_LENGTH, parameter_length);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb,
parameter_tvb = tvb_new_subset_length_caplen(message_tvb,
offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH,
MIN(parameter_length, actual_length),
parameter_length);
@ -9392,7 +9392,7 @@ dissect_isup_confusion_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
message_tvb, offset + parameter_pointer, PARAMETER_LENGTH_IND_LENGTH,
parameter_length);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb,
parameter_tvb = tvb_new_subset_length_caplen(message_tvb,
offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH,
MIN(parameter_length, actual_length),
parameter_length);
@ -9545,7 +9545,7 @@ dissect_japan_chg_inf(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isu
parameter_type,
val_to_str_ext_const(parameter_type, &japan_isup_parameter_type_value_ext, "unknown"));
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(1, actual_length), 1);
parameter_tvb = tvb_new_subset_length_caplen(message_tvb, offset, MIN(1, actual_length), 1);
chg_inf_type = tvb_get_guint8(parameter_tvb, 0);
dissect_japan_chg_inf_type(parameter_tvb, parameter_tree, parameter_item);
offset += 1;
@ -9569,7 +9569,7 @@ dissect_japan_chg_inf(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isu
proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer,
PARAMETER_LENGTH_IND_LENGTH, parameter_length);
actual_length = tvb_ensure_captured_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb,
parameter_tvb = tvb_new_subset_length_caplen(message_tvb,
offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH,
MIN(parameter_length, actual_length),
parameter_length);

View File

@ -423,7 +423,7 @@ dissect_kdsp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
}
payload_len = (length + FRAME_HEADER_LEN) - offset;
if (cptbitmap & DATA_PACKLEN_FLAG) {
payload_tvb = tvb_new_subset(tvb, offset, payload_len, reported_payload_len);
payload_tvb = tvb_new_subset_length_caplen(tvb, offset, payload_len, reported_payload_len);
if (cptbitmap & DATA_DLT_FLAG) {
dissector_try_uint(subdissector_dlt_table, datalink_type, payload_tvb, pinfo, tree);

View File

@ -2051,7 +2051,7 @@ dissect_krb5_AD_WIN2K_PAC_struct(proto_tree *tree, tvbuff_t *tvb, int offset, as
proto_tree_add_uint(tr, hf_krb_w2k_pac_offset, tvb, offset, 4, pac_offset);
offset += 8;
next_tvb=tvb_new_subset(tvb, pac_offset, pac_size, pac_size);
next_tvb=tvb_new_subset_length_caplen(tvb, pac_offset, pac_size, pac_size);
switch(pac_type){
case PAC_LOGON_INFO:
dissect_krb5_PAC_LOGON_INFO(tr, next_tvb, 0, actx);

View File

@ -356,7 +356,7 @@ dissect_payload_kink_ap_req(packet_info *pinfo, tvbuff_t *tvb, int offset, proto
tvbuff_t *krb_tvb;
krb_ap_req_length = payload_length - PAYLOAD_HEADER;
krb_tvb=tvb_new_subset(tvb, offset, (krb_ap_req_length>tvb_captured_length_remaining(tvb, offset))?tvb_captured_length_remaining(tvb, offset):krb_ap_req_length, krb_ap_req_length);
krb_tvb=tvb_new_subset_length_caplen(tvb, offset, (krb_ap_req_length>tvb_captured_length_remaining(tvb, offset))?tvb_captured_length_remaining(tvb, offset):krb_ap_req_length, krb_ap_req_length);
keytype=kerberos_output_keytype();
dissect_kerberos_main(krb_tvb, pinfo, payload_kink_ap_req_tree, FALSE, NULL);
/*offset += krb_ap_req_length;*/
@ -411,7 +411,7 @@ dissect_payload_kink_ap_rep(packet_info *pinfo, tvbuff_t *tvb, int offset, proto
tvbuff_t *krb_tvb;
krb_ap_rep_length = payload_length - PAYLOAD_HEADER;
krb_tvb=tvb_new_subset(tvb, offset, (krb_ap_rep_length>tvb_captured_length_remaining(tvb, offset))?tvb_captured_length_remaining(tvb, offset):krb_ap_rep_length, krb_ap_rep_length);
krb_tvb=tvb_new_subset_length_caplen(tvb, offset, (krb_ap_rep_length>tvb_captured_length_remaining(tvb, offset))?tvb_captured_length_remaining(tvb, offset):krb_ap_rep_length, krb_ap_rep_length);
keytype=kerberos_output_keytype();
dissect_kerberos_main(krb_tvb, pinfo, payload_kink_ap_rep_tree, FALSE, NULL);
@ -464,7 +464,7 @@ dissect_payload_kink_krb_error(packet_info *pinfo, tvbuff_t *tvb, int offset, pr
tvbuff_t *krb_tvb;
krb_error_length = payload_length - KINK_KRB_ERROR_HEADER;
krb_tvb=tvb_new_subset(tvb, offset, (krb_error_length>tvb_captured_length_remaining(tvb, offset))?tvb_captured_length_remaining(tvb, offset):krb_error_length, krb_error_length);
krb_tvb=tvb_new_subset_length_caplen(tvb, offset, (krb_error_length>tvb_captured_length_remaining(tvb, offset))?tvb_captured_length_remaining(tvb, offset):krb_error_length, krb_error_length);
dissect_kerberos_main(krb_tvb, pinfo, payload_kink_krb_error_tree, FALSE, NULL);
/*offset += krb_error_length;*/
@ -630,7 +630,7 @@ dissect_payload_kink_isakmp(packet_info *pinfo, tvbuff_t *tvb, int offset, proto
reported_length = tvb_reported_length_remaining(tvb, offset);
if (reported_length > (int)isakmp_length)
reported_length = isakmp_length;
isakmp_tvb = tvb_new_subset(tvb, offset, length, reported_length);
isakmp_tvb = tvb_new_subset_length_caplen(tvb, offset, length, reported_length);
isakmp_dissect_payloads(isakmp_tvb, payload_kink_isakmp_tree, 1, inner_next_pload, 0, isakmp_length, pinfo);
}
@ -688,7 +688,7 @@ dissect_payload_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, int offset, prot
tvbuff_t *next_tvb;
guint8 *plaintext=NULL;
next_tvb=tvb_new_subset(tvb, offset, MIN(tvb_captured_length_remaining(tvb, offset), encrypt_length), encrypt_length);
next_tvb=tvb_new_subset_length_caplen(tvb, offset, MIN(tvb_captured_length_remaining(tvb, offset), encrypt_length), encrypt_length);
plaintext=decrypt_krb5_data(tree, pinfo, 0, next_tvb, keytype, NULL);
if(plaintext){
next_tvb=tvb_new_child_real_data(tvb, plaintext, encrypt_length, encrypt_length);

View File

@ -287,7 +287,7 @@ dissect_lapdm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U
if( !MIN(len, available_length) )
return 2;
payload = tvb_new_subset(tvb, LAPDM_HEADER_LEN, MIN(len,available_length), len);
payload = tvb_new_subset_length_caplen(tvb, LAPDM_HEADER_LEN, MIN(len,available_length), len);
/* Potentially segmented I frame
*/

View File

@ -512,7 +512,7 @@ dissect_lapsat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dissec
payload = tvb_new_child_real_data(tvb, data, plen, plen);
} else {
/* Last nibble doesn't need merging */
payload = tvb_new_subset(tvb, hlen, plen, plen);
payload = tvb_new_subset_length_caplen(tvb, hlen, plen, plen);
}
add_new_data_source(pinfo, payload, "LAPSat Payload");

View File

@ -3919,7 +3919,7 @@ one_more_pdu:
*/
length = length_remaining;
if (length > msg_len) length = msg_len;
msg_tvb = tvb_new_subset(tvb, offset, length, msg_len);
msg_tvb = tvb_new_subset_length_caplen(tvb, offset, length, msg_len);
/*
* Now dissect the LDAP message.
@ -4108,7 +4108,7 @@ static void
*/
length = length_remaining;
if (length > sasl_msg_len) length = sasl_msg_len;
sasl_tvb = tvb_new_subset(tvb, offset, length, sasl_msg_len);
sasl_tvb = tvb_new_subset_length_caplen(tvb, offset, length, sasl_msg_len);
proto_tree_add_uint(ldap_tree, hf_ldap_sasl_buffer_length, sasl_tvb, 0, 4, sasl_len);
@ -4134,7 +4134,7 @@ static void
tmp_length = tvb_reported_length_remaining(sasl_tvb, 4);
if ((guint)tmp_length > sasl_len)
tmp_length = sasl_len;
gssapi_tvb = tvb_new_subset(sasl_tvb, 4, tmp_length, sasl_len);
gssapi_tvb = tvb_new_subset_length_caplen(sasl_tvb, 4, tmp_length, sasl_len);
/* Attempt decryption of the GSSAPI wrapped data if possible */
gssapi_encrypt.gssapi_data_encrypted = FALSE;

View File

@ -3199,7 +3199,7 @@ dissect_ldp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
length = length_remaining;
if (length > plen + 4)
length = plen + 4;
next_tvb = tvb_new_subset(tvb, offset, length, plen + 4);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, length, plen + 4);
/*
* Dissect the LDP packet.

View File

@ -404,7 +404,7 @@ dissect_data_segment(proto_tree *ltp_tree, tvbuff_t *tvb,packet_info *pinfo,int
}
}
datatvb = tvb_new_subset(new_tvb, parse_offset, (int)parse_length - parse_offset, tvb_captured_length(new_tvb));
datatvb = tvb_new_subset_length_caplen(new_tvb, parse_offset, (int)parse_length - parse_offset, tvb_captured_length(new_tvb));
bundle_size = call_dissector(bundle_handle, datatvb, pinfo, ltp_data_data_tree);
if(bundle_size == 0) { /*Couldn't parse bundle*/
col_set_str(pinfo->cinfo, COL_INFO, "Dissection Failed");

View File

@ -873,7 +873,7 @@ dissect_modbus_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8
}
/* Build a new tvb containing just the data payload */
next_tvb = tvb_new_subset(tvb, payload_start, payload_len, reported_len);
next_tvb = tvb_new_subset_length_caplen(tvb, payload_start, payload_len, reported_len);
switch ( function_code ) {

View File

@ -595,7 +595,7 @@ dissect_meta(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
break;
case META_PROTO_DXT_HDLC:
next_dissector = mtp2_handle;
next_tvb = tvb_new_subset(tvb, item_len + META_HEADER_SIZE,
next_tvb = tvb_new_subset_length_caplen(tvb, item_len + META_HEADER_SIZE,
tvb_reported_length(tvb)-item_len-META_HEADER_SIZE-2, -1);
break;
default:

View File

@ -474,7 +474,7 @@ static int dissect_mgcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
sectionlen = tvb_find_dot_line(tvb, tvb_sectionbegin, -1, &tvb_sectionend);
if (sectionlen != -1)
{
dissect_mgcp_message(tvb_new_subset(tvb, tvb_sectionbegin,
dissect_mgcp_message(tvb_new_subset_length_caplen(tvb, tvb_sectionbegin,
sectionlen, sectionlen),
pinfo, tree, mgcp_tree, ti);
tvb_sectionbegin = tvb_sectionend;
@ -577,7 +577,7 @@ static void dissect_mgcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
sectionlen = tvb_find_line_end(tvb, 0, -1, &tvb_sectionend, FALSE);
if (sectionlen > 0)
{
dissect_mgcp_firstline(tvb_new_subset(tvb, tvb_sectionbegin,
dissect_mgcp_firstline(tvb_new_subset_length_caplen(tvb, tvb_sectionbegin,
sectionlen, sectionlen), pinfo,
mgcp_tree, mi);
}
@ -590,7 +590,7 @@ static void dissect_mgcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
&tvb_sectionend);
if (sectionlen > 0)
{
dissect_mgcp_params(tvb_new_subset(tvb, tvb_sectionbegin, sectionlen, sectionlen),
dissect_mgcp_params(tvb_new_subset_length_caplen(tvb, tvb_sectionbegin, sectionlen, sectionlen),
mgcp_tree, mi);
}
}

View File

@ -937,7 +937,7 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
return TRUE;
}
es = tvb_new_subset(tvb, offset / 8, -1, length);
es = tvb_new_subset_length_caplen(tvb, offset / 8, -1, length);
if (tvb_get_ntoh24(es, 0) == PES_PREFIX)
dissect_mpeg_pes(es, pinfo, tree, NULL);
else if (tvb_get_guint8(es, 0) == 0xff)

View File

@ -311,7 +311,7 @@ static void dissect_msdp_sa(tvbuff_t *tvb, packet_info *pinfo,
if (reported_length > length)
reported_length = length;
next_tvb = tvb_new_subset(tvb, *offset, available_length,
next_tvb = tvb_new_subset_length_caplen(tvb, *offset, available_length,
reported_length);
/* Set the information columns read-only so that they
* reflect the MSDP packet rather than the

View File

@ -253,7 +253,7 @@ dissect_mstp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset, 2, ENC_BIG_ENDIAN);
/* NPDU - call the Vendor specific dissector */
next_tvb = tvb_new_subset(tvb, offset+2,
next_tvb = tvb_new_subset_length_caplen(tvb, offset+2,
mstp_tvb_pdu_len-2, mstp_frame_pdu_len);
}

View File

@ -175,7 +175,7 @@ mtp2_decode_crc16(tvbuff_t *tvb, proto_tree *fh_tree, packet_info *pinfo)
reported_len -= 2;
if (len > reported_len)
len = reported_len;
next_tvb = tvb_new_subset(tvb, proto_offset, len, reported_len);
next_tvb = tvb_new_subset_length_caplen(tvb, proto_offset, len, reported_len);
} else {
/*
* We have the entire packet, and it includes a 2-byte FCS.
@ -183,7 +183,7 @@ mtp2_decode_crc16(tvbuff_t *tvb, proto_tree *fh_tree, packet_info *pinfo)
*/
len -= 2;
reported_len -= 2;
next_tvb = tvb_new_subset(tvb, proto_offset, len, reported_len);
next_tvb = tvb_new_subset_length_caplen(tvb, proto_offset, len, reported_len);
/*
* Compute the FCS and put it into the tree.

View File

@ -3175,7 +3175,7 @@ de_esm_user_data_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
it = proto_tree_add_item(tree, hf_nas_eps_esm_user_data_cont, tvb, offset, len, ENC_NA);
if (g_nas_eps_user_data_container_as_ip) {
subtree = proto_item_add_subtree(it, ett_nas_eps_esm_user_data_cont);
user_data_cont_tvb = tvb_new_subset(tvb, offset, len, len);
user_data_cont_tvb = tvb_new_subset_length_caplen(tvb, offset, len, len);
switch (tvb_get_guint8(user_data_cont_tvb, 0) & 0xf0) {
case 0x40:
col_append_str(pinfo->cinfo, COL_PROTOCOL, "/");

View File

@ -149,7 +149,7 @@ dissect_nb_rtpmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
captured_length = tvb_reported_length_remaining(tvb, offset + 5);
if (captured_length > (gint)length)
captured_length = length;
next_tvb = tvb_new_subset(tvb, offset+5, captured_length,
next_tvb = tvb_new_subset_length_caplen(tvb, offset+5, captured_length,
length);
if (first_rtp_payload_seen)

View File

@ -1684,7 +1684,7 @@ dissect_nbss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
length = length_remaining;
if (length > plen)
length = plen;
next_tvb = tvb_new_subset(tvb, offset, length, plen);
next_tvb = tvb_new_subset_length_caplen(tvb, offset, length, plen);
dissect_nbss_packet(next_tvb, pinfo, tree, is_cifs);

View File

@ -1263,7 +1263,7 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
} else {
/*
* XXX - do this by using -1 and -1 as the length
* arguments to "tvb_new_subset()" and then calling
* arguments to "tvb_new_subset_length_caplen()" and then calling
* "tvb_set_reported_length()"? That'll throw an
* exception if "data_len" goes past the reported
* length of the packet, but that's arguably a
@ -1273,7 +1273,7 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (length_remaining > data_len)
length_remaining = data_len;
if (data_len != 0) {
call_data_dissector(tvb_new_subset(tvb, offset,
call_data_dissector(tvb_new_subset_length_caplen(tvb, offset,
length_remaining, data_len),
pinfo, ncp_tree);
}

View File

@ -6949,7 +6949,7 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequ
else
{
/* This is either a beggining or middle fragment on second dissection */
frag_tvb = tvb_new_subset(tvb, 0, -1, -1);
frag_tvb = tvb_new_subset_length_caplen(tvb, 0, -1, -1);
if (request_value->nds_frag)
{
col_add_fstr(pinfo->cinfo, COL_INFO, "[NDS Fragment 0x%08x]", frags[frag_count].nds_frag);
@ -6972,12 +6972,12 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequ
/*
* There are no bytes so Dissect this
*/
frag_tvb = tvb_new_subset(tvb, 0, -1, -1);
frag_tvb = tvb_new_subset_length_caplen(tvb, 0, -1, -1);
}
if (frag_tvb == NULL)
{
/* This is a fragment packet */
frag_tvb = tvb_new_subset (tvb, 0, -1, -1);
frag_tvb = tvb_new_subset_length_caplen(tvb, 0, -1, -1);
nds_data_handle = find_dissector("data");
call_dissector(nds_data_handle, frag_tvb, pinfo, tree);
}

View File

@ -1364,7 +1364,7 @@ dissect_execute_cdb_cdb(tvbuff_t *tvb, int offset, packet_info *pinfo,
tvb_rlen=tvb_reported_length_remaining(tvb, offset);
if(tvb_rlen>16)
tvb_rlen=16;
cdb_tvb=tvb_new_subset(tvb, offset, tvb_len, tvb_rlen);
cdb_tvb=tvb_new_subset_length_caplen(tvb, offset, tvb_len, tvb_rlen);
if(ndmp_conv_data->task && !ndmp_conv_data->task->itlq){
ndmp_conv_data->task->itlq=wmem_new(wmem_file_scope(), itlq_nexus_t);
@ -1417,7 +1417,7 @@ dissect_execute_cdb_payload(tvbuff_t *tvb, int offset, packet_info *pinfo, proto
tvb_rlen=tvb_reported_length_remaining(tvb, offset);
if(tvb_rlen>(int)payload_len)
tvb_rlen=payload_len;
data_tvb=tvb_new_subset(tvb, offset, tvb_len, tvb_rlen);
data_tvb=tvb_new_subset_length_caplen(tvb, offset, tvb_len, tvb_rlen);
if(ndmp_conv_data->task && ndmp_conv_data->task->itlq){
/* ndmp conceptually always send both read and write

View File

@ -448,7 +448,7 @@ dissect_negoex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _
* Construct a new TVB covering just this message and pass to the
* sub-dissector
*/
msg_tvb = tvb_new_subset(tvb,
msg_tvb = tvb_new_subset_length_caplen(tvb,
start_offset,
MIN(message_len, tvb_captured_length(tvb)),
message_len);

View File

@ -2258,7 +2258,7 @@ dissect_fhandle_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *
/* Functionality for choosing subdissector is controlled through Decode As as NFS doesn't
have a unique identifier to determine subdissector */
fh_tvb = tvb_new_subset(tvb, offset, fhlen, fhlen);
fh_tvb = tvb_new_subset_length_caplen(tvb, offset, fhlen, fhlen);
if (!dissector_try_uint(nfs_fhandle_table, 0, fh_tvb, pinfo, tree))
dissect_fhandle_data_unknown(fh_tvb, pinfo, tree, NULL);
}

View File

@ -307,7 +307,7 @@ dissect_nordic_ble(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
context = wmem_new0(wmem_packet_scope(), btle_context_t);
offset = dissect_header(tvb, pinfo, tree, context, &bad_length);
payload_tvb = tvb_new_subset(tvb, offset, -1, tvb_captured_length(tvb) - offset);
payload_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, tvb_captured_length(tvb) - offset);
if (!bad_length) {
call_dissector_with_data(btle_dissector_handle, payload_tvb, pinfo, tree, context);

View File

@ -344,7 +344,7 @@ decode_iei_ns_pdu(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
proto_tree_add_bytes_format(bi->nsip_tree, hf_nsip_ns_pdu, bi->tvb, ie_start_offset,
ie->total_length, NULL,
"NS PDU (%u bytes)", ie->value_length);
next_tvb = tvb_new_subset(bi->tvb, bi->offset, ie->value_length, -1);
next_tvb = tvb_new_subset_length_caplen(bi->tvb, bi->offset, ie->value_length, -1);
if (nsip_handle) {
gboolean was_recursive;
was_recursive = nsip_is_recursive;

Some files were not shown because too many files have changed in this diff Show More