From 4a5ca5c76e199694bba8a21418f52ca0f30322d1 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Wed, 7 Jan 2015 18:13:23 -0500 Subject: bytes_to_ep_str -> bytes_to_str Change-Id: Ifcda8328dedec0ef4104c3a124d6246f99493750 Reviewed-on: https://code.wireshark.org/review/6389 Reviewed-by: Anders Broman --- epan/dissectors/packet-ap1394.c | 5 +---- epan/dissectors/packet-arp.c | 6 +++--- epan/dissectors/packet-ber.c | 2 +- epan/dissectors/packet-btsdp.c | 2 +- epan/dissectors/packet-isakmp.c | 2 +- epan/dissectors/packet-ncp2222.inc | 6 +++--- epan/dissectors/packet-rtmpt.c | 4 ++-- epan/dissectors/packet-sigcomp.c | 2 +- epan/dissectors/packet-ssl-utils.c | 5 ++++- epan/dissectors/packet-ubertooth.c | 2 +- epan/dissectors/packet-yami.c | 4 ++-- 11 files changed, 20 insertions(+), 20 deletions(-) (limited to 'epan/dissectors') diff --git a/epan/dissectors/packet-ap1394.c b/epan/dissectors/packet-ap1394.c index 6c15804322..eaa2483a9e 100644 --- a/epan/dissectors/packet-ap1394.c +++ b/epan/dissectors/packet-ap1394.c @@ -66,24 +66,21 @@ dissect_ap1394(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti; proto_tree *fh_tree = NULL; - const guint8 *src_addr, *dst_addr; guint16 etype; tvbuff_t *next_tvb; col_set_str(pinfo->cinfo, COL_PROTOCOL, "IP/IEEE1394"); col_clear(pinfo->cinfo, COL_INFO); - src_addr=tvb_get_ptr(tvb, 8, 8); TVB_SET_ADDRESS(&pinfo->dl_src, AT_EUI64, tvb, 8, 8); TVB_SET_ADDRESS(&pinfo->src, AT_EUI64, tvb, 8, 8); - dst_addr=tvb_get_ptr(tvb, 0, 8); TVB_SET_ADDRESS(&pinfo->dl_dst, AT_EUI64, tvb, 0, 8); TVB_SET_ADDRESS(&pinfo->dst, AT_EUI64, tvb, 0, 8); if (tree) { ti = proto_tree_add_protocol_format(tree, proto_ap1394, tvb, 0, 18, "Apple IP-over-IEEE 1394, Src: %s, Dst: %s", - bytes_to_ep_str(src_addr, 8), bytes_to_ep_str(dst_addr, 8)); + address_to_str(wmem_packet_scope(), &pinfo->src), address_to_str(wmem_packet_scope(), &pinfo->dst)); fh_tree = proto_item_add_subtree(ti, ett_ap1394); proto_tree_add_item(fh_tree, hf_ap1394_dst, tvb, 0, 8, ENC_NA); proto_tree_add_item(fh_tree, hf_ap1394_src, tvb, 8, 8, ENC_NA); diff --git a/epan/dissectors/packet-arp.c b/epan/dissectors/packet-arp.c index 5ab5edf64e..ada4fb0a1c 100644 --- a/epan/dissectors/packet-arp.c +++ b/epan/dissectors/packet-arp.c @@ -397,7 +397,7 @@ arpproaddr_to_str(const guint8 *ad, int ad_len, guint16 type) return address_to_str(wmem_packet_scope(), &addr); } } - return bytes_to_ep_str(ad, ad_len); + return bytes_to_str(wmem_packet_scope(), ad, ad_len); } #define MAX_E164_STR_LEN 20 @@ -431,7 +431,7 @@ atmarpnum_to_str(const guint8 *ad, int ad_tl) * * XXX - break down into subcomponents. */ - return bytes_to_ep_str(ad, ad_len); + return bytes_to_str(wmem_packet_scope(), ad, ad_len); } } @@ -452,7 +452,7 @@ atmarpsubaddr_to_str(const guint8 *ad, int ad_tl) * * XXX - break down into subcomponents? */ - return bytes_to_ep_str(ad, ad_len); + return bytes_to_str(wmem_packet_scope(), ad, ad_len); } const value_string arp_hrd_vals[] = { diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c index d5baf3c80b..6784dc0048 100644 --- a/epan/dissectors/packet-ber.c +++ b/epan/dissectors/packet-ber.c @@ -3964,7 +3964,7 @@ dissect_ber_constrained_bitstring(gboolean implicit_tag, asn1_ctx_t *actx, proto if (bitstring[byteno]) { expert_add_info_format( actx->pinfo, item, &ei_ber_bits_unknown, - "Unknown bit(s): 0x%s", bytes_to_ep_str(bitstring, len)); + "Unknown bit(s): 0x%s", bytes_to_str(wmem_packet_scope(), bitstring, len)); break; } } diff --git a/epan/dissectors/packet-btsdp.c b/epan/dissectors/packet-btsdp.c index 0fe6837e54..82385b76eb 100644 --- a/epan/dissectors/packet-btsdp.c +++ b/epan/dissectors/packet-btsdp.c @@ -910,7 +910,7 @@ print_uuid(uuid_t *uuid) i_uuid += 1; } - return bytes_to_ep_str(uuid->data, uuid->size); + return bytes_to_str(wmem_packet_scope(), uuid->data, uuid->size); } } diff --git a/epan/dissectors/packet-isakmp.c b/epan/dissectors/packet-isakmp.c index 6afb452314..fbcfe9f9e5 100644 --- a/epan/dissectors/packet-isakmp.c +++ b/epan/dissectors/packet-isakmp.c @@ -4739,7 +4739,7 @@ dissect_enc(tvbuff_t *tvb, if (tvb_memeql(tvb, offset, md, icd_len) == 0) { proto_item_append_text(icd_item, "[correct]"); } else { - proto_item_append_text(icd_item, "[incorrect, should be %s]", bytes_to_ep_str(md, icd_len)); + proto_item_append_text(icd_item, "[incorrect, should be %s]", bytes_to_str(wmem_packet_scope(), md, icd_len)); expert_add_info(pinfo, icd_item, &ei_isakmp_ikev2_integrity_checksum); } gcry_md_close(md_hd); diff --git a/epan/dissectors/packet-ncp2222.inc b/epan/dissectors/packet-ncp2222.inc index f0af06b55f..9c2fbc2eb2 100644 --- a/epan/dissectors/packet-ncp2222.inc +++ b/epan/dissectors/packet-ncp2222.inc @@ -2782,7 +2782,7 @@ build_expert_data(proto_tree *ncp_tree, const char *hf_name, char *buffer, } case 21: case 22: /* Bytes */ - g_snprintf(buffer, (gulong) buffer_size, "%s", bytes_to_ep_str(get_finfo_value_string(PTREE_FINFO(tree_pointer)), get_finfo_length(PTREE_FINFO(tree_pointer)))); + g_snprintf(buffer, (gulong) buffer_size, "%s", bytes_to_str(wmem_packet_scope(), get_finfo_value_string(PTREE_FINFO(tree_pointer)), get_finfo_length(PTREE_FINFO(tree_pointer)))); break; default: /* Dont currently handle. Only need string, integers, and bytes */ g_snprintf(buffer, (gulong) buffer_size, "Unsupported Expert Type"); @@ -7744,7 +7744,7 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo, if (info_type != 0) { /* Is this a string or not? */ if (info_type == 1) { /* Is this bytes? */ - byte_string = bytes_to_ep_str(get_finfo_value_string(finfo), get_finfo_length(finfo)); + byte_string = bytes_to_str(wmem_packet_scope(), get_finfo_value_string(finfo), get_finfo_length(finfo)); col_append_fstr(pinfo->cinfo, COL_INFO, (const gchar*) ncp_rec->req_info_str->first_string, byte_string); @@ -7781,7 +7781,7 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo, if (info_type != 0) { /* Is this a string or not? */ if (info_type == 1) { /* Is this bytes? */ - byte_string = bytes_to_ep_str(get_finfo_value_string(finfo), get_finfo_length(finfo)); + byte_string = bytes_to_str(wmem_packet_scope(), get_finfo_value_string(finfo), get_finfo_length(finfo)); col_append_fstr(pinfo->cinfo, COL_INFO, (const gchar*) ncp_rec->req_info_str->repeat_string, byte_string); diff --git a/epan/dissectors/packet-rtmpt.c b/epan/dissectors/packet-rtmpt.c index bdc2504882..703386a3d5 100644 --- a/epan/dissectors/packet-rtmpt.c +++ b/epan/dissectors/packet-rtmpt.c @@ -1530,9 +1530,9 @@ dissect_amf3_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, proto_item iValueOffset += iValueLength; iByteArrayValue = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, iValueOffset, iArrayLength); proto_tree_add_bytes(val_tree, hf_amf_bytearray, tvb, iValueOffset, iArrayLength, iByteArrayValue); - proto_item_append_text(ti, " %s", bytes_to_ep_str(iByteArrayValue, iArrayLength)); + proto_item_append_text(ti, " %s", bytes_to_str(wmem_packet_scope(), iByteArrayValue, iArrayLength)); if (parent_ti != NULL) - proto_item_append_text(parent_ti, " %s", bytes_to_ep_str(iByteArrayValue, iArrayLength)); + proto_item_append_text(parent_ti, " %s", bytes_to_str(wmem_packet_scope(), iByteArrayValue, iArrayLength)); } else { /* the upper 28 bits of the integer value are a object reference index */ proto_tree_add_uint(val_tree, hf_amf_object_reference, tvb, iValueOffset, iValueLength, iIntegerValue >> 1); diff --git a/epan/dissectors/packet-sigcomp.c b/epan/dissectors/packet-sigcomp.c index 59e8b77d10..a2d1fc0e41 100644 --- a/epan/dissectors/packet-sigcomp.c +++ b/epan/dissectors/packet-sigcomp.c @@ -690,7 +690,7 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr offset = offset + len; } tvb_memcpy(tvb, partial_state, offset, partial_state_len); - partial_state_str = bytes_to_ep_str(partial_state, partial_state_len); + partial_state_str = bytes_to_str(wmem_packet_scope(), partial_state, partial_state_len); proto_tree_add_string(sigcomp_tree,hf_sigcomp_partial_state, tvb, offset, partial_state_len, partial_state_str); offset = offset + partial_state_len; diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c index aef9101385..d369a504de 100644 --- a/epan/dissectors/packet-ssl-utils.c +++ b/epan/dissectors/packet-ssl-utils.c @@ -3603,6 +3603,7 @@ ssl_load_pkcs12(FILE* fp, const gchar *cert_passwd, char** err) { static char buf_name[256]; static char buf_email[128]; unsigned char buf_keyid[32]; + char *tmp_str; gnutls_pkcs12_t ssl_p12 = NULL; gnutls_x509_crt_t ssl_cert = NULL; @@ -3726,7 +3727,9 @@ ssl_load_pkcs12(FILE* fp, const gchar *cert_passwd, char** err) { if (ret < 0) { g_strlcpy(buf_keyid, "", 32); } private_key->x509_cert = ssl_cert; - ssl_debug_printf( "Certificate imported: %s <%s>, KeyID %s\n", buf_name, buf_email, bytes_to_ep_str(buf_keyid, (int) buf_len)); + tmp_str = bytes_to_str(NULL, buf_keyid, (int) buf_len); + ssl_debug_printf( "Certificate imported: %s <%s>, KeyID %s\n", buf_name, buf_email, tmp_str); + wmem_free(NULL, tmp_str); break; case GNUTLS_BAG_PKCS8_KEY: diff --git a/epan/dissectors/packet-ubertooth.c b/epan/dissectors/packet-ubertooth.c index 4eef348ac0..8b7fefdb6f 100644 --- a/epan/dissectors/packet-ubertooth.c +++ b/epan/dissectors/packet-ubertooth.c @@ -1781,7 +1781,7 @@ dissect_ubertooth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat proto_tree_add_bytes(main_tree, hf_serial_number, tvb, offset, 16, (guint8 *) serial); col_append_fstr(pinfo->cinfo, COL_INFO, " = %s", - bytes_to_ep_str((guint8 *) serial, 16)); + bytes_to_str(wmem_packet_scope(), (guint8 *) serial, 16)); offset += 16; break; diff --git a/epan/dissectors/packet-yami.c b/epan/dissectors/packet-yami.c index 61533043d4..7f66e90c94 100644 --- a/epan/dissectors/packet-yami.c +++ b/epan/dissectors/packet-yami.c @@ -231,7 +231,7 @@ dissect_yami_parameter(tvbuff_t *tvb, proto_tree *tree, int offset, proto_item * offset += 4; val = tvb_get_ptr(tvb, offset, val_len); - repr = bytes_to_ep_str(val, val_len); + repr = bytes_to_str(wmem_packet_scope(), val, val_len); proto_item_append_text(ti, ", Type: binary, Value: %s", repr); offset += (val_len + 3) & ~3; @@ -395,7 +395,7 @@ dissect_yami_parameter(tvbuff_t *tvb, proto_tree *tree, int offset, proto_item * offset += 4; val = tvb_get_ptr(tvb, offset, val_len); - repr = bytes_to_ep_str(val, val_len); + repr = bytes_to_str(wmem_packet_scope(), val, val_len); proto_item_append_text(ti, "%s, ", repr); offset += (val_len + 3) & ~3; -- cgit v1.2.3