diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-02-11 02:43:07 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-02-11 02:43:07 +0000 |
commit | d8659693eff66f7e89c53871776c455cd11b4cae (patch) | |
tree | add1992656e851b438ee6b2abe2c452a5479b260 /epan | |
parent | 8d03f63e1762609119ce81e55132c0d8c17f3433 (diff) | |
download | wireshark-d8659693eff66f7e89c53871776c455cd11b4cae.tar.gz |
Check for places where tvb_bytes_to_str() or tvb_get_bytes_to_str_punct()
should be used (instead of the non-tvb functions with a call to tvb_get_ptr()).
Use those functions in a bunch of places.
svn path=/trunk/; revision=35911
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-bootp.c | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-dhcpv6.c | 5 | ||||
-rw-r--r-- | epan/dissectors/packet-q931.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-q933.c | 8 |
4 files changed, 10 insertions, 17 deletions
diff --git a/epan/dissectors/packet-bootp.c b/epan/dissectors/packet-bootp.c index c5e7e2ff9a..a3d79c6188 100644 --- a/epan/dissectors/packet-bootp.c +++ b/epan/dissectors/packet-bootp.c @@ -1698,7 +1698,7 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, int voff, } else if ((optlen < 69)) { /* CableLabs DSS_ID */ s_option = tvb_get_guint8(tvb, optoff); s_len = tvb_get_guint8(tvb, optoff+1); - + if (s_option == 1) { /*First DSS_ID*/ proto_tree_add_text(v_tree, tvb, optoff+2, s_len, "Suboption 1: Primary DSS_ID = \"%s\"", tvb_format_stringzpad(tvb, optoff+2, s_len)); @@ -1708,7 +1708,7 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, int voff, } else { proto_tree_add_text(v_tree, tvb, optoff, s_len, "Unknown"); } - + if (optlen > s_len+2) { /* Second DSS_ID*/ s_option = tvb_get_guint8(tvb, optoff+2+s_len); s_len = tvb_get_guint8(tvb, optoff+1+2+s_len); @@ -1721,7 +1721,7 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, int voff, } else { proto_tree_add_text(v_tree, tvb, optoff+s_len+2, s_len, "Unknown"); } - } + } } else { proto_tree_add_text(v_tree, tvb, optoff, optlen, "Error: Invalid length of DHCP option!"); } @@ -2601,7 +2601,7 @@ dissect_vendor_cablelabs_suboption(proto_tree *v_tree, tvbuff_t *tvb, if (subopt_len == 3) { proto_tree_add_text(v_tree, tvb, optoff, subopt_len+2, "Suboption %d: Organization Unique Identifier = %s", subopt, - bytes_to_str_punct(tvb_get_ptr(tvb, suboptoff, 3), 3, ':')); + tvb_bytes_to_str_punct(tvb, suboptoff, 3, ':')); } else if (subopt_len == 6) { proto_tree_add_text(v_tree, tvb, optoff, subopt_len+2, "Suboption %d: Organization Unique Identifier = \"%s\"", subopt, @@ -2631,7 +2631,7 @@ dissect_vendor_cablelabs_suboption(proto_tree *v_tree, tvbuff_t *tvb, proto_tree_add_text(v_tree, tvb, optoff, subopt_len+2, "Suboption %d: %s = %s", subopt, o43cablelabs_opt[subopt].text, - bytes_to_str_punct(tvb_get_ptr(tvb, suboptoff, 6), 6, ':')); + tvb_bytes_to_str_punct(tvb, suboptoff, 6, ':')); } else { proto_tree_add_text(v_tree, tvb, optoff, subopt_len+2, "Suboption %d: %s (%d byte%s)" , diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c index 6e46c03a7c..5cfff0aa68 100644 --- a/epan/dissectors/packet-dhcpv6.c +++ b/epan/dissectors/packet-dhcpv6.c @@ -821,7 +821,7 @@ dissect_cablelabs_specific_opts(proto_tree *v_tree, tvbuff_t *tvb, int voff, int opt_len = tlv_len; if (tlv_len == 3) { proto_item_append_text(ti, "%s", - bytes_to_str_punct(tvb_get_ptr(tvb, sub_off, 3), 3, ':')); + tvb_bytes_to_str_punct(tvb, sub_off, 3, ':')); } else if (tlv_len == 6) { proto_item_append_text(ti, "\"%s\"", tvb_format_stringzpad(tvb, sub_off, tlv_len)); } else { @@ -943,8 +943,7 @@ dissect_cablelabs_specific_opts(proto_tree *v_tree, tvbuff_t *tvb, int voff, int } else { /*proto_item_append_text(ti, "CM MAC Address Option = %s", */ - proto_item_append_text(ti, "%s", - bytes_to_str_punct(tvb_get_ptr(tvb, sub_off, opt_len), opt_len, ':')); + proto_item_append_text(ti, "%s", tvb_bytes_to_str_punct(tvb, sub_off, opt_len, ':')); /* tvb_bytes_to_str(tvb, sub_off, opt_len)); */ } sub_off += field_len; diff --git a/epan/dissectors/packet-q931.c b/epan/dissectors/packet-q931.c index 466e619d45..00f7ba407f 100644 --- a/epan/dissectors/packet-q931.c +++ b/epan/dissectors/packet-q931.c @@ -3213,9 +3213,7 @@ dissect_q931_IEs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root_tree, proto_tree_add_text(ie_tree, tvb, offset + 2, info_element_len, "Data: %s", - bytes_to_str( - tvb_get_ptr(tvb, offset + 2, - info_element_len), + tvb_bytes_to_str(tvb, offset + 2, info_element_len)); } break; diff --git a/epan/dissectors/packet-q933.c b/epan/dissectors/packet-q933.c index 8255be41f4..31732ee63f 100644 --- a/epan/dissectors/packet-q933.c +++ b/epan/dissectors/packet-q933.c @@ -1267,9 +1267,7 @@ dissect_q933_channel_identification_ie(tvbuff_t *tvb, int offset, int len, if (identifier_len != 0) { proto_tree_add_text(tree, tvb, identifier_offset, identifier_len, "Interface identifier: %s", - bytes_to_str( - tvb_get_ptr(tvb, identifier_offset, identifier_len), - identifier_len)); + tvb_bytes_to_str(tvb, identifier_offset, identifier_len)); } } @@ -2152,9 +2150,7 @@ dissect_q933(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_text(ie_tree, tvb, offset + 2, info_element_len, "Data: %s", - bytes_to_str( - tvb_get_ptr(tvb, offset + 2, - info_element_len), + tvb_bytes_to_str(tvb, offset + 2, info_element_len)); break; } |