diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-02-19 23:17:07 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-02-19 23:17:07 +0000 |
commit | 29715ccc8f78d9a2f791437f49d6718615795c15 (patch) | |
tree | 36c72f6cae5e8e8ed09086eef9249eac9a65ca04 /asn1 | |
parent | 5a5d872639a9e20893f82079af06f4caec980277 (diff) |
How can I get a new tvbuff that starts at an offset within a given
tvbuff and runs to the end of the tvbuff? Let me count the ways....
Replace a bunch of different ways of doing that (some incorrect, in that
they're not properly handling tvbuffs where the captured and reported
lengths are different) with tvb_new_subset_remaining().
svn path=/trunk/; revision=47751
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/c1222/packet-c1222-template.c | 4 | ||||
-rw-r--r-- | asn1/ldap/packet-ldap-template.c | 2 | ||||
-rw-r--r-- | asn1/qsig/qsig.cnf | 2 | ||||
-rw-r--r-- | asn1/ros/packet-ros-template.c | 2 | ||||
-rw-r--r-- | asn1/rtse/packet-rtse-template.c | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/asn1/c1222/packet-c1222-template.c b/asn1/c1222/packet-c1222-template.c index 1733e02bbc..ec1949ab29 100644 --- a/asn1/c1222/packet-c1222-template.c +++ b/asn1/c1222/packet-c1222-template.c @@ -907,7 +907,7 @@ dissect_epsem(tvbuff_t *tvb, int offset, guint32 len, packet_info *pinfo, proto_ if (len2 <= 0) return offset; buffer = (guchar *)tvb_memdup(tvb, offset, len2); - epsem_buffer = tvb_new_subset(tvb, offset, -1, -1); + epsem_buffer = tvb_new_subset_remaining(tvb, offset); if (c1222_decrypt) { if (!decrypt_packet(buffer, len2, FALSE)) { #ifdef HAVE_LIBGCRYPT @@ -923,7 +923,7 @@ dissect_epsem(tvbuff_t *tvb, int offset, guint32 len, packet_info *pinfo, proto_ break; default: /* it's not encrypted */ - epsem_buffer = tvb_new_subset(tvb, offset, -1, -1); + epsem_buffer = tvb_new_subset_remaining(tvb, offset); } /* it's only encrypted if we have an undecrypted payload */ if (encrypted) { diff --git a/asn1/ldap/packet-ldap-template.c b/asn1/ldap/packet-ldap-template.c index 76cbda7020..e8cd9aabdf 100644 --- a/asn1/ldap/packet-ldap-template.c +++ b/asn1/ldap/packet-ldap-template.c @@ -967,7 +967,7 @@ one_more_pdu: * same blob */ if(tvb_length_remaining(tvb, offset)>=6){ - tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), -1); + tvb = tvb_new_subset_remaining(tvb, offset); offset = 0; goto one_more_pdu; diff --git a/asn1/qsig/qsig.cnf b/asn1/qsig/qsig.cnf index f76e64429c..681f306b25 100644 --- a/asn1/qsig/qsig.cnf +++ b/asn1/qsig/qsig.cnf @@ -145,7 +145,7 @@ NameData TYPE = FT_STRING DISPLAY = BASE_NONE #.FN_BODY Extension/extensionArgument tvbuff_t *next_tvb; - next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), tvb_reported_length_remaining(tvb, offset)); + next_tvb = tvb_new_subset_remaining(tvb, offset); if (!dissector_try_string(extension_dissector_table, extension_oid, next_tvb, actx->pinfo, tree)) { proto_item *item=NULL; proto_tree *next_tree=NULL; diff --git a/asn1/ros/packet-ros-template.c b/asn1/ros/packet-ros-template.c index e00b348384..ea608ca75f 100644 --- a/asn1/ros/packet-ros-template.c +++ b/asn1/ros/packet-ros-template.c @@ -207,7 +207,7 @@ call_ros_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *p { tvbuff_t *next_tvb; - next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), tvb_reported_length_remaining(tvb, offset)); + next_tvb = tvb_new_subset_remaining(tvb, offset); if(!ros_try_string(oid, next_tvb, pinfo, tree) && !dissector_try_string(ros_oid_dissector_table, oid, next_tvb, pinfo, tree)){ diff --git a/asn1/rtse/packet-rtse-template.c b/asn1/rtse/packet-rtse-template.c index 37c704d474..99a0a163a8 100644 --- a/asn1/rtse/packet-rtse-template.c +++ b/asn1/rtse/packet-rtse-template.c @@ -145,7 +145,7 @@ call_rtse_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info * { tvbuff_t *next_tvb; - next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), tvb_reported_length_remaining(tvb, offset)); + next_tvb = tvb_new_subset_remaining(tvb, offset); if(!dissector_try_string(rtse_oid_dissector_table, oid, next_tvb, pinfo, tree)){ proto_item *item=proto_tree_add_text(tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "RTSE: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid); proto_tree *next_tree=proto_item_add_subtree(item, ett_rtse_unknown); |