aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debian/libwireshark0.symbols1
-rw-r--r--epan/dissectors/asn1/snmp/packet-snmp-template.c6
-rw-r--r--epan/dissectors/packet-acap.c10
-rw-r--r--epan/dissectors/packet-aim.c12
-rw-r--r--epan/dissectors/packet-ansi_637.c2
-rw-r--r--epan/dissectors/packet-ansi_a.c6
-rw-r--r--epan/dissectors/packet-bencode.c6
-rw-r--r--epan/dissectors/packet-bittorrent.c2
-rw-r--r--epan/dissectors/packet-bootp.c8
-rw-r--r--epan/dissectors/packet-cops.c7
-rw-r--r--epan/dissectors/packet-dhcp-failover.c2
-rw-r--r--epan/dissectors/packet-dmp.c4
-rw-r--r--epan/dissectors/packet-dns.c72
-rw-r--r--epan/dissectors/packet-extreme.c4
-rw-r--r--epan/dissectors/packet-foundry.c2
-rw-r--r--epan/dissectors/packet-ftp.c2
-rw-r--r--epan/dissectors/packet-gift.c10
-rw-r--r--epan/dissectors/packet-giop.c4
-rw-r--r--epan/dissectors/packet-http.c14
-rw-r--r--epan/dissectors/packet-icap.c2
-rw-r--r--epan/dissectors/packet-icmpv6.c6
-rw-r--r--epan/dissectors/packet-ieee80211.c12
-rw-r--r--epan/dissectors/packet-imap.c2
-rw-r--r--epan/dissectors/packet-kismet.c16
-rw-r--r--epan/dissectors/packet-lwres.c6
-rw-r--r--epan/dissectors/packet-memcache.c2
-rw-r--r--epan/dissectors/packet-mmse.c10
-rw-r--r--epan/dissectors/packet-ms-mms.c8
-rw-r--r--epan/dissectors/packet-msn-messenger.c2
-rw-r--r--epan/dissectors/packet-ndps.c2
-rw-r--r--epan/dissectors/packet-pop.c2
-rw-r--r--epan/dissectors/packet-pvfs2.c7
-rw-r--r--epan/dissectors/packet-rdp.c2
-rw-r--r--epan/dissectors/packet-rpc.c5
-rw-r--r--epan/dissectors/packet-rtsp.c9
-rw-r--r--epan/dissectors/packet-sigcomp.c4
-rw-r--r--epan/dissectors/packet-slsk.c6
-rw-r--r--epan/dissectors/packet-smb-common.c2
-rw-r--r--epan/dissectors/packet-smb.c110
-rw-r--r--epan/dissectors/packet-smtp.c42
-rw-r--r--epan/dissectors/packet-snmp.c16
-rw-r--r--epan/dissectors/packet-turbocell.c2
-rw-r--r--epan/dissectors/packet-wbxml.c2
-rw-r--r--epan/strutil.c95
-rw-r--r--epan/strutil.h13
45 files changed, 323 insertions, 236 deletions
diff --git a/debian/libwireshark0.symbols b/debian/libwireshark0.symbols
index d83593ccb4..e04c23dfe1 100644
--- a/debian/libwireshark0.symbols
+++ b/debian/libwireshark0.symbols
@@ -576,6 +576,7 @@ libwireshark.so.0 libwireshark0 #MINVER#
follow_tvb_tap_listener@Base 2.1.0
format_text@Base 1.9.1
format_text_chr@Base 1.12.0~rc1
+ format_text_wmem@Base 2.3.0
format_text_wsp@Base 1.9.1
format_uri@Base 1.9.1
fragment_add@Base 1.9.1
diff --git a/epan/dissectors/asn1/snmp/packet-snmp-template.c b/epan/dissectors/asn1/snmp/packet-snmp-template.c
index 00ea2e2619..13719286a4 100644
--- a/epan/dissectors/asn1/snmp/packet-snmp-template.c
+++ b/epan/dissectors/asn1/snmp/packet-snmp-template.c
@@ -69,12 +69,6 @@
#include <wsutil/wsgcrypt.h>
-/* Take a pointer that may be null and return a pointer that's not null
- by turning null pointers into pointers to the above null string,
- and, if the argument pointer wasn't null, make sure we handle
- non-printable characters in the string by escaping them. */
-#define SAFE_STRING(s, l) (((s) != NULL) ? format_text((s), (l)) : "")
-
#define PNAME "Simple Network Management Protocol"
#define PSNAME "SNMP"
#define PFNAME "snmp"
diff --git a/epan/dissectors/packet-acap.c b/epan/dissectors/packet-acap.c
index 209220c1a1..30bcc1e02c 100644
--- a/epan/dissectors/packet-acap.c
+++ b/epan/dissectors/packet-acap.c
@@ -124,7 +124,7 @@ dissect_acap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
*/
col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s",
is_request ? "Request" : "Response",
- format_text(line, linelen));
+ format_text_wmem(wmem_packet_scope(), line, linelen));
if (tree) {
ti = proto_tree_add_item(tree, hfi_acap, tvb, offset, -1,
@@ -159,10 +159,10 @@ dissect_acap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
if (tokenlen != 0) {
if (is_request) {
proto_tree_add_string(reqresp_tree, &hfi_acap_request_tag, tvb, offset,
- tokenlen, format_text(line, tokenlen));
+ tokenlen, format_text_wmem(wmem_packet_scope(), line, tokenlen));
} else {
proto_tree_add_string(reqresp_tree, &hfi_acap_response_tag, tvb, offset,
- tokenlen, format_text(line, tokenlen));
+ tokenlen, format_text_wmem(wmem_packet_scope(), line, tokenlen));
}
offset += (int)(next_token - line);
linelen -= (int)(next_token - line);
@@ -175,10 +175,10 @@ dissect_acap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
if (linelen != 0) {
if (is_request) {
proto_tree_add_string(reqresp_tree, &hfi_acap_request_data, tvb, offset,
- linelen, format_text(line, linelen));
+ linelen, format_text_wmem(wmem_packet_scope(), line, linelen));
} else {
proto_tree_add_string(reqresp_tree, &hfi_acap_response_data, tvb, offset,
- linelen, format_text(line, linelen));
+ linelen, format_text_wmem(wmem_packet_scope(), line, linelen));
}
}
diff --git a/epan/dissectors/packet-aim.c b/epan/dissectors/packet-aim.c
index 0327887598..8cf264aa89 100644
--- a/epan/dissectors/packet-aim.c
+++ b/epan/dissectors/packet-aim.c
@@ -1198,7 +1198,7 @@ dissect_aim_tlv_value_string (proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb
string_len = tvb_reported_length(tvb);
buf = tvb_get_string_enc(wmem_packet_scope(), tvb, 0, string_len, ENC_UTF_8|ENC_NA);
- proto_item_set_text(ti, "Value: %s", format_text(buf, string_len));
+ proto_item_set_text(ti, "Value: %s", format_text_wmem(wmem_packet_scope(), buf, string_len));
return string_len;
}
@@ -1317,7 +1317,7 @@ dissect_aim_tlv_value_messageblock (proto_item *ti, guint16 valueid _U_, tvbuff_
/* The actual message */
buf = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, blocklen - 4, ENC_ASCII|ENC_NA);
proto_item_append_text(ti, "Message: %s ",
- format_text(buf, blocklen - 4));
+ format_text_wmem(wmem_packet_scope(), buf, blocklen - 4));
proto_tree_add_item(entry, hf_aim_messageblock_message, tvb,
offset, blocklen-4, ENC_ASCII|ENC_NA);
@@ -1882,7 +1882,7 @@ static int dissect_aim_buddylist_oncoming(tvbuff_t *tvb, packet_info *pinfo, pro
col_set_str(pinfo->cinfo, COL_INFO, "Oncoming Buddy");
col_append_fstr(pinfo->cinfo, COL_INFO, ": %s",
- format_text(buddyname, buddyname_length));
+ format_text_wmem(wmem_packet_scope(), buddyname, buddyname_length));
offset += dissect_aim_buddyname(tvb, pinfo, offset, buddy_tree);
@@ -1905,7 +1905,7 @@ static int dissect_aim_buddylist_offgoing(tvbuff_t *tvb, packet_info *pinfo, pro
col_set_str(pinfo->cinfo, COL_INFO, "Offgoing Buddy");
col_append_fstr(pinfo->cinfo, COL_INFO, ": %s",
- format_text(buddyname, buddyname_length));
+ format_text_wmem(wmem_packet_scope(), buddyname, buddyname_length));
offset += dissect_aim_buddyname(tvb, pinfo, offset, buddy_tree);
@@ -3031,7 +3031,7 @@ dissect_aim_msg_outgoing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *msg_tree
/* Add the outgoing username to the info column */
buddyname_length = aim_get_buddyname(&buddyname, tvb, offset);
col_append_fstr(pinfo->cinfo, COL_INFO, " to: %s",
- format_text(buddyname, buddyname_length));
+ format_text_wmem(wmem_packet_scope(), buddyname, buddyname_length));
offset = dissect_aim_buddyname(tvb, pinfo, offset, msg_tree);
@@ -3402,7 +3402,7 @@ static int dissect_aim_snac_signon_signon(tvbuff_t *tvb, packet_info *pinfo,
buddyname_length = aim_get_buddyname( &buddyname, tvb, offset );
col_append_fstr(pinfo->cinfo, COL_INFO, " Username: %s",
- format_text(buddyname, buddyname_length));
+ format_text_wmem(wmem_packet_scope(), buddyname, buddyname_length));
if(tree) {
offset+=dissect_aim_buddyname(tvb, pinfo, offset, tree);
diff --git a/epan/dissectors/packet-ansi_637.c b/epan/dissectors/packet-ansi_637.c
index 7426dedf11..a5cd72645a 100644
--- a/epan/dissectors/packet-ansi_637.c
+++ b/epan/dissectors/packet-ansi_637.c
@@ -1387,7 +1387,7 @@ tele_param_cb_num(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint len
proto_tree_add_string_format(tree, hf_ansi_637_tele_cb_num_number, tvb, offset, num_fields,
(gchar *) poctets,
"Number: %s",
- (gchar *) format_text(poctets, num_fields));
+ (gchar *) format_text_wmem(wmem_packet_scope(), poctets, num_fields));
}
else
{
diff --git a/epan/dissectors/packet-ansi_a.c b/epan/dissectors/packet-ansi_a.c
index bb5c62b1d6..28306c8523 100644
--- a/epan/dissectors/packet-ansi_a.c
+++ b/epan/dissectors/packet-ansi_a.c
@@ -3583,7 +3583,7 @@ elem_clg_party_ascii_num(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu
proto_tree_add_string_format(tree, hf_ansi_a_clg_party_ascii_num, tvb, curr_offset, len - (curr_offset - offset),
(gchar *) poctets,
"Digits: %s",
- (gchar *) format_text(poctets, len - (curr_offset - offset)));
+ (gchar *) format_text_wmem(wmem_packet_scope(), poctets, len - (curr_offset - offset)));
proto_item_append_text(data_p->elem_item, " - (%s)", poctets);
@@ -5629,7 +5629,7 @@ elem_rev_ms_info_recs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint
proto_tree_add_string_format(subtree, hf_ansi_a_cld_party_ascii_num, tvb, curr_offset, oct_len,
(gchar *) poctets,
"Digits: %s",
- (gchar *) format_text(poctets, oct_len));
+ (gchar *) format_text_wmem(wmem_packet_scope(), poctets, oct_len));
curr_offset += oct_len;
break;
@@ -6096,7 +6096,7 @@ elem_cld_party_ascii_num(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu
proto_tree_add_string_format(tree, hf_ansi_a_cld_party_ascii_num, tvb, curr_offset, len - (curr_offset - offset),
(gchar *) poctets,
"Digits: %s",
- (gchar *) format_text(poctets, len - (curr_offset - offset)));
+ (gchar *) format_text_wmem(wmem_packet_scope(), poctets, len - (curr_offset - offset)));
proto_item_append_text(data_p->elem_item, " - (%s)", poctets);
diff --git a/epan/dissectors/packet-bencode.c b/epan/dissectors/packet-bencode.c
index bb44bc27ea..e24c32b66c 100644
--- a/epan/dissectors/packet-bencode.c
+++ b/epan/dissectors/packet-bencode.c
@@ -84,13 +84,11 @@ static int dissect_bencoding_str(tvbuff_t *tvb, packet_info *pinfo,
if (treeadd == 1) {
proto_item_append_text(ti, " Key: %s",
- format_text((guchar *)tvb_memdup(wmem_packet_scope(),
- tvb, offset + used, stringlen), stringlen));
+ tvb_format_text(tvb, offset + used, stringlen));
}
if (treeadd == 2) {
proto_item_append_text(ti, " Value: %s",
- format_text((guchar *)tvb_memdup(wmem_packet_scope(),
- tvb, offset + used, stringlen), stringlen));
+ tvb_format_text(tvb, offset + used, stringlen));
}
}
return used + stringlen;
diff --git a/epan/dissectors/packet-bittorrent.c b/epan/dissectors/packet-bittorrent.c
index b5a6fb4b08..76aeb6ed6d 100644
--- a/epan/dissectors/packet-bittorrent.c
+++ b/epan/dissectors/packet-bittorrent.c
@@ -518,7 +518,7 @@ dissect_bittorrent_welcome (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
version = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + (int)strlen(peer_id[i].id),
peer_id[i].ver_len, ENC_ASCII);
proto_tree_add_string_format(tree, hf_bittorrent_version, tvb, offset, 20, version, "Client is %s v%s",
- peer_id[i].name, format_text((guchar*)version, peer_id[i].ver_len));
+ peer_id[i].name, format_text_wmem(wmem_packet_scope(), (guchar*)version, peer_id[i].ver_len));
break;
}
}
diff --git a/epan/dissectors/packet-bootp.c b/epan/dissectors/packet-bootp.c
index 8cb24c3641..3907173dd6 100644
--- a/epan/dissectors/packet-bootp.c
+++ b/epan/dissectors/packet-bootp.c
@@ -2364,7 +2364,7 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, proto_item
if (fqdn_flags & F_FQDN_E) {
get_dns_name(tvb, optoff+3, optlen-3, optoff+3, &dns_name, &dns_name_len);
proto_tree_add_string(v_tree, hf_bootp_fqdn_name,
- tvb, optoff+3, optlen-3, format_text(dns_name, dns_name_len));
+ tvb, optoff+3, optlen-3, format_text_wmem(wmem_packet_scope(), dns_name, dns_name_len));
} else {
proto_tree_add_item(v_tree, hf_bootp_fqdn_asciiname,
tvb, optoff+3, optlen-3, ENC_ASCII|ENC_NA);
@@ -2678,7 +2678,7 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, proto_item
proto_tree_add_string(v_tree, hf_bootp_option_sip_server_name, tvb, optoff + offset, consumedx, dns_name);
} else {
/* RFC 3396 is used, so the option is split into several option 120. We don't link fqdn with v_tree. */
- proto_tree_add_string(v_tree, hf_bootp_option_sip_server_name, tvb, 0, 0, format_text(dns_name, dns_name_len));
+ proto_tree_add_string(v_tree, hf_bootp_option_sip_server_name, tvb, 0, 0, format_text_wmem(wmem_packet_scope(), dns_name, dns_name_len));
}
offset += consumedx;
}
@@ -5705,7 +5705,7 @@ dissect_packetcable_ietf_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v
case 0:
get_dns_name(tvb, suboptoff, subopt_len, suboptoff, &dns_name, &dns_name_len);
- proto_item_append_text(vti, "%s (%u byte%s)", format_text(dns_name, dns_name_len),
+ proto_item_append_text(vti, "%s (%u byte%s)", format_text_wmem(wmem_packet_scope(), dns_name, dns_name_len),
subopt_len - 1, plurality(subopt_len, "", "s") );
break;
@@ -5763,7 +5763,7 @@ dissect_packetcable_ietf_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v
case PKT_CCC_KRB_REALM: /* String values */
get_dns_name(tvb, suboptoff, subopt_len, suboptoff, &dns_name, &dns_name_len);
- proto_item_append_text(vti, "%s (%u byte%s)", format_text(dns_name, dns_name_len),
+ proto_item_append_text(vti, "%s (%u byte%s)", format_text_wmem(wmem_packet_scope(), dns_name, dns_name_len),
subopt_len, plurality(subopt_len, "", "s") );
suboptoff += subopt_len;
break;
diff --git a/epan/dissectors/packet-cops.c b/epan/dissectors/packet-cops.c
index fd91cf0419..5cb4ef941b 100644
--- a/epan/dissectors/packet-cops.c
+++ b/epan/dissectors/packet-cops.c
@@ -77,13 +77,6 @@ static gboolean cops_desegment = TRUE;
#define COPS_OBJECT_HDR_SIZE 4
-#if 0
-/* Null string of type "guchar[]". */
-static const guchar nullstring[] = "";
-
-#define SAFE_STRING(s) (((s) != NULL) ? (s) : nullstring)
-#endif
-
static const value_string cops_flags_vals[] = {
{ 0x00, "None" },
{ 0x01, "Solicited Message Flag Bit" },
diff --git a/epan/dissectors/packet-dhcp-failover.c b/epan/dissectors/packet-dhcp-failover.c
index 3dcecda0f3..58ca369126 100644
--- a/epan/dissectors/packet-dhcp-failover.c
+++ b/epan/dissectors/packet-dhcp-failover.c
@@ -636,7 +636,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
hf_dhcpfo_vendor_class, tvb, offset,
option_length, ENC_ASCII, wmem_packet_scope(), &vendor_class_str);
proto_item_append_text(oi,", \"%s\"",
- format_text(vendor_class_str, option_length));
+ format_text_wmem(wmem_packet_scope(), vendor_class_str, option_length));
break;
case DHCP_FO_PD_LEASE_EXPIRATION_TIME:
diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c
index 8413259107..d07da090ec 100644
--- a/epan/dissectors/packet-dmp.c
+++ b/epan/dissectors/packet-dmp.c
@@ -2666,7 +2666,7 @@ static gint dissect_mts_identifier (tvbuff_t *tvb, packet_info *pinfo, proto_tre
mts_id = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, dmp.mts_id_length);
}
proto_item_append_text (dmp.mts_id_item, " (%zu bytes decompressed)", strlen(mts_id));
- mts_id = format_text (mts_id, strlen(mts_id));
+ mts_id = format_text_wmem(wmem_packet_scope(), mts_id, strlen(mts_id));
if (subject) {
ti = proto_tree_add_string (tree, hf_message_subj_mts_id, tvb, offset, dmp.mts_id_length, mts_id);
hidden_item = proto_tree_add_string (tree, hf_mts_id, tvb, offset, dmp.mts_id_length, mts_id);
@@ -2722,7 +2722,7 @@ static gint dissect_ipm_identifier (tvbuff_t *tvb, packet_info *pinfo, proto_tre
ipm_id = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, ipm_id_length);
}
proto_item_append_text (tf, " (%zu bytes decompressed)", strlen(ipm_id));
- ipm_id = format_text (ipm_id, strlen(ipm_id));
+ ipm_id = format_text_wmem(wmem_packet_scope(), ipm_id, strlen(ipm_id));
if (subject) {
ti = proto_tree_add_string (tree, hf_message_subj_ipm_id, tvb, offset, ipm_id_length, ipm_id);
hidden_item = proto_tree_add_string (tree, hf_ipm_id, tvb, offset, ipm_id_length, ipm_id);
diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c
index 86ba3c3eb0..5c2201d525 100644
--- a/epan/dissectors/packet-dns.c
+++ b/epan/dissectors/packet-dns.c
@@ -1419,7 +1419,7 @@ dissect_dns_query(tvbuff_t *tvb, int offset, int dns_data_offset,
* The name might contain octets that aren't printable characters,
* format it for display.
*/
- name_out = format_text(name, name_len);
+ name_out = format_text_wmem(wmem_packet_scope(), name, name_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s %s", type_name, name_out);
if (is_mdns) {
@@ -1787,7 +1787,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
* The name might contain octets that aren't printable characters,
* format it for display.
*/
- name_out = format_text(name, name_len);
+ name_out = format_text_wmem(wmem_packet_scope(), name, name_len);
if (dns_type != T_OPT) {
rr_tree = proto_tree_add_subtree_format(dns_tree, tvb, offsetx,
(data_offset - data_start) + data_len,
@@ -1837,7 +1837,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
int ns_name_len;
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &ns_name, &ns_name_len);
- name_out = format_text(ns_name, ns_name_len);
+ name_out = format_text_wmem(wmem_packet_scope(), ns_name, ns_name_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name_out);
proto_item_append_text(trr, ", ns %s", name_out);
proto_tree_add_string(rr_tree, hf_dns_ns, tvb, cur_offset, used_bytes, name_out);
@@ -1854,7 +1854,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &hostname_str, &hostname_len);
- name_out = format_text(hostname_str, hostname_len);
+ name_out = format_text_wmem(wmem_packet_scope(), hostname_str, hostname_len);
proto_tree_add_string(rr_tree, hf_dns_md, tvb, cur_offset, used_bytes, name_out);
}
break;
@@ -1869,7 +1869,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &hostname_str, &hostname_len);
- name_out = format_text(hostname_str, hostname_len);
+ name_out = format_text_wmem(wmem_packet_scope(), hostname_str, hostname_len);
proto_tree_add_string(rr_tree, hf_dns_mf, tvb, cur_offset, used_bytes, name_out);
}
break;
@@ -1881,7 +1881,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
int cname_len;
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &cname, &cname_len);
- name_out = format_text(cname, cname_len);
+ name_out = format_text_wmem(wmem_packet_scope(), cname, cname_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name_out);
proto_item_append_text(trr, ", cname %s", name_out);
proto_tree_add_string(rr_tree, hf_dns_cname, tvb, cur_offset, used_bytes, name_out);
@@ -1899,14 +1899,14 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
proto_item *ti_soa;
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &mname, &mname_len);
- name_out = format_text(mname, mname_len);
+ name_out = format_text_wmem(wmem_packet_scope(), mname, mname_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name_out);
proto_item_append_text(trr, ", mname %s", name_out);
proto_tree_add_string(rr_tree, hf_dns_soa_mname, tvb, cur_offset, used_bytes, name_out);
cur_offset += used_bytes;
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &rname, &rname_len);
- name_out = format_text(rname, rname_len);
+ name_out = format_text_wmem(wmem_packet_scope(), rname, rname_len);
proto_tree_add_string(rr_tree, hf_dns_soa_rname, tvb, cur_offset, used_bytes, name_out);
cur_offset += used_bytes;
@@ -1940,7 +1940,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &hostname_str, &hostname_len);
- name_out = format_text(hostname_str, hostname_len);
+ name_out = format_text_wmem(wmem_packet_scope(), hostname_str, hostname_len);
proto_tree_add_string(rr_tree, hf_dns_mb, tvb, cur_offset, used_bytes, name_out);
}
break;
@@ -1954,7 +1954,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &hostname_str, &hostname_len);
- name_out = format_text(hostname_str, hostname_len);
+ name_out = format_text_wmem(wmem_packet_scope(), hostname_str, hostname_len);
proto_tree_add_string(rr_tree, hf_dns_mg, tvb, cur_offset, used_bytes, name_out);
}
break;
@@ -1968,7 +1968,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &hostname_str, &hostname_len);
- name_out = format_text(hostname_str, hostname_len);
+ name_out = format_text_wmem(wmem_packet_scope(), hostname_str, hostname_len);
proto_tree_add_string(rr_tree, hf_dns_mr, tvb, cur_offset, used_bytes, name_out);
}
break;
@@ -2055,7 +2055,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
int pname_len;
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &pname, &pname_len);
- name_out = format_text(pname, pname_len);
+ name_out = format_text_wmem(wmem_packet_scope(), pname, pname_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name_out);
proto_item_append_text(trr, ", %s", name_out);
proto_tree_add_string(rr_tree, hf_dns_ptr_domain_name, tvb, cur_offset, used_bytes, name_out);
@@ -2103,7 +2103,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &rmailbx_str, &rmailbx_len);
- name_out = format_text(rmailbx_str, rmailbx_len);
+ name_out = format_text_wmem(wmem_packet_scope(), rmailbx_str, rmailbx_len);
proto_tree_add_string(rr_tree, hf_dns_minfo_r_mailbox, tvb, cur_offset, used_bytes, name_out);
cur_offset += used_bytes;
@@ -2122,7 +2122,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
preference = tvb_get_ntohs(tvb, cur_offset);
used_bytes = get_dns_name(tvb, cur_offset + 2, 0, dns_data_offset, &mx_name, &mx_name_len);
- name_out = format_text(mx_name, mx_name_len);
+ name_out = format_text_wmem(wmem_packet_scope(), mx_name, mx_name_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %u %s", preference, name_out);
proto_item_append_text(trr, ", preference %u, mx %s",
preference, name_out);
@@ -2165,12 +2165,12 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &mbox_dname, &mbox_dname_len);
- name_out = format_text(mbox_dname, mbox_dname_len);
+ name_out = format_text_wmem(wmem_packet_scope(), mbox_dname, mbox_dname_len);
proto_tree_add_string(rr_tree, hf_dns_rp_mailbox, tvb, cur_offset, used_bytes, name_out);
cur_offset += used_bytes;
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &txt_dname, &txt_dname_len);
- name_out = format_text(txt_dname, txt_dname_len);
+ name_out = format_text_wmem(wmem_packet_scope(), txt_dname, txt_dname_len);
proto_tree_add_string(rr_tree, hf_dns_rp_txt_rr, tvb, cur_offset, used_bytes, name_out);
}
break;
@@ -2184,7 +2184,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
used_bytes = get_dns_name(tvb, cur_offset + 2, 0, dns_data_offset, &host_name, &host_name_len);
- name_out = format_text(host_name, host_name_len);
+ name_out = format_text_wmem(wmem_packet_scope(), host_name, host_name_len);
proto_tree_add_item(rr_tree, hf_dns_afsdb_subtype, tvb, cur_offset, 2, ENC_BIG_ENDIAN);
cur_offset += 2;
@@ -2247,7 +2247,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
used_bytes = get_dns_name(tvb, cur_offset + 2, 0, dns_data_offset, &host_name, &host_name_len);
- name_out = format_text(host_name, host_name_len);
+ name_out = format_text_wmem(wmem_packet_scope(), host_name, host_name_len);
proto_tree_add_item(rr_tree, hf_dns_rt_preference, tvb, cur_offset, 2, ENC_BIG_ENDIAN);
cur_offset += 2;
@@ -2274,7 +2274,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &nsap_ptr_owner, &nsap_ptr_owner_len);
- name_out = format_text(nsap_ptr_owner, nsap_ptr_owner_len);
+ name_out = format_text_wmem(wmem_packet_scope(), nsap_ptr_owner, nsap_ptr_owner_len);
proto_tree_add_string(rr_tree, hf_dns_nsap_ptr_owner, tvb, cur_offset, used_bytes, name_out);
}
break;
@@ -2340,12 +2340,12 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
cur_offset += 2;
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &px_map822_dnsname, &px_map822_len);
- name_out = format_text(px_map822_dnsname, px_map822_len);
+ name_out = format_text_wmem(wmem_packet_scope(), px_map822_dnsname, px_map822_len);
proto_tree_add_string(rr_tree, hf_dns_px_map822, tvb, cur_offset, used_bytes, name_out);
cur_offset += used_bytes;
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &px_mapx400_dnsname, &px_mapx400_len);
- name_out = format_text(px_mapx400_dnsname, px_mapx400_len);
+ name_out = format_text_wmem(wmem_packet_scope(), px_mapx400_dnsname, px_mapx400_len);
proto_tree_add_string(rr_tree, hf_dns_px_mapx400, tvb, cur_offset, used_bytes, name_out);
/*cur_offset += px_mapx400_len;*/
}
@@ -2453,7 +2453,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset,
&next_domain_name, &next_domain_name_len);
- name_out = format_text(next_domain_name, next_domain_name_len);
+ name_out = format_text_wmem(wmem_packet_scope(), next_domain_name, next_domain_name_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name_out);
proto_item_append_text(trr, ", next domain name %s", name_out);
proto_tree_add_string(rr_tree, hf_dns_nxt_next_domain_name, tvb, cur_offset, used_bytes, name_out);
@@ -2486,7 +2486,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
cur_offset += 2;
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &target, &target_len);
- name_out = format_text(target, target_len);
+ name_out = format_text_wmem(wmem_packet_scope(), target, target_len);
proto_tree_add_string(rr_tree, hf_dns_srv_target, tvb, cur_offset, used_bytes, name_out);
@@ -2546,7 +2546,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
/* Replacement */
used_bytes = get_dns_name(tvb, offset, 0, dns_data_offset, &replacement, &replacement_len);
- name_out = format_text(replacement, replacement_len);
+ name_out = format_text_wmem(wmem_packet_scope(), replacement, replacement_len);
ti_len = proto_tree_add_uint(rr_tree, hf_dns_naptr_replacement_length, tvb, offset, 0, replacement_len);
PROTO_ITEM_SET_GENERATED(ti_len);
@@ -2567,7 +2567,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
int kx_name_len;
used_bytes = get_dns_name(tvb, cur_offset + 2, 0, dns_data_offset, &kx_name, &kx_name_len);
- name_out = format_text(kx_name, kx_name_len);
+ name_out = format_text_wmem(wmem_packet_scope(), kx_name, kx_name_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %u %s", tvb_get_ntohs(tvb, cur_offset), name_out);
proto_item_append_text(trr, ", preference %u, kx %s",
tvb_get_ntohs(tvb, cur_offset), name_out);
@@ -2634,7 +2634,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
pname = "";
pname_len = 0;
}
- name_out = format_text(pname, pname_len);
+ name_out = format_text_wmem(wmem_packet_scope(), pname, pname_len);
set_address(&suffix_addr, AT_IPv6, 16, suffix.bytes);
col_append_fstr(pinfo->cinfo, COL_INFO, " %d %s %s",
@@ -2667,7 +2667,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset,
&dname, &dname_len);
- name_out = format_text(dname, dname_len);
+ name_out = format_text_wmem(wmem_packet_scope(), dname, dname_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name_out);
proto_item_append_text(trr, ", dname %s", name_out);
proto_tree_add_string(rr_tree, hf_dns_dname, tvb, cur_offset, used_bytes, name_out);
@@ -2935,7 +2935,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
break;
case 3:
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &gw, &gw_name_len);
- name_out = format_text(gw, gw_name_len);
+ name_out = format_text_wmem(wmem_packet_scope(), gw, gw_name_len);
proto_tree_add_string(rr_tree, hf_dns_ipseckey_gateway_dns, tvb, cur_offset, used_bytes, name_out);
cur_offset += gw_name_len;
@@ -2989,7 +2989,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
rr_len -= 2;
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &signer_name, &signer_name_len);
- name_out = format_text(signer_name, signer_name_len);
+ name_out = format_text_wmem(wmem_packet_scope(), signer_name, signer_name_len);
proto_tree_add_string(rr_tree, hf_dns_rrsig_signers_name, tvb, cur_offset, used_bytes, name_out);
cur_offset += signer_name_len;
rr_len -= signer_name_len;
@@ -3009,7 +3009,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset,
&next_domain_name, &next_domain_name_len);
- name_out = format_text(next_domain_name, next_domain_name_len);
+ name_out = format_text_wmem(wmem_packet_scope(), next_domain_name, next_domain_name_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name_out);
proto_item_append_text(trr, ", next domain name %s", name_out);
proto_tree_add_string(rr_tree, hf_dns_nsec_next_domain_name, tvb, cur_offset, used_bytes, name_out);
@@ -3193,7 +3193,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
while (rr_len > 1) {
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &rend_server_dns_name, &rendezvous_len);
- name_out = format_text(rend_server_dns_name, rendezvous_len);
+ name_out = format_text_wmem(wmem_packet_scope(), rend_server_dns_name, rendezvous_len);
proto_tree_add_string(rr_tree, hf_dns_hip_rendezvous_server, tvb, cur_offset, used_bytes, name_out);
cur_offset += used_bytes;
rr_len -= used_bytes;
@@ -3295,7 +3295,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
cur_offset += 2;
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &lp_str, &lp_len);
- name_out = format_text(lp_str, lp_len);
+ name_out = format_text_wmem(wmem_packet_scope(), lp_str, lp_len);
proto_tree_add_string(rr_tree, hf_dns_ilnp_locatorfqdn, tvb, cur_offset, used_bytes, name_out);
/*cur_offset += lp_len;*/
@@ -3334,7 +3334,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
proto_item *key_item;
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &tkey_algname, &tkey_algname_len);
- name_out = format_text(tkey_algname, tkey_algname_len);
+ name_out = format_text_wmem(wmem_packet_scope(), tkey_algname, tkey_algname_len);
proto_tree_add_string(rr_tree, hf_dns_tkey_algo_name, tvb, cur_offset, used_bytes, name_out);
cur_offset += used_bytes;
@@ -3419,7 +3419,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
proto_item *ti;
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &tsig_algname, &tsig_algname_len);
- name_out = format_text(tsig_algname, tsig_algname_len);
+ name_out = format_text_wmem(wmem_packet_scope(), tsig_algname, tsig_algname_len);
proto_tree_add_string(rr_tree, hf_dns_tsig_algorithm_name, tvb, cur_offset, used_bytes, name_out);
cur_offset += used_bytes;
@@ -3494,7 +3494,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
value_len = data_len - (tag_len + 2);
value = tvb_get_string_enc(wmem_packet_scope(), tvb, cur_offset + 1 + tag_len, value_len, ENC_ASCII|ENC_NA);
- value = format_text(value, value_len);
+ value = format_text_wmem(wmem_packet_scope(), value, value_len);
if (strncmp(tag, "issue", tag_len) == 0) {
cur_hf = hf_dns_caa_issue;
@@ -3565,7 +3565,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
cur_offset += 4;
used_bytes = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &dname, &dname_len);
- name_out = format_text(dname, dname_len);
+ name_out = format_text_wmem(wmem_packet_scope(), dname, dname_len);
proto_tree_add_string(rr_tree, hf_dns_winsr_name_result_domain, tvb, cur_offset, used_bytes, name_out);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name_out);
proto_item_append_text(trr, ", name result domain %s", name_out);
diff --git a/epan/dissectors/packet-extreme.c b/epan/dissectors/packet-extreme.c
index 4d7d34a9ee..3fdbff838c 100644
--- a/epan/dissectors/packet-extreme.c
+++ b/epan/dissectors/packet-extreme.c
@@ -430,7 +430,7 @@ dissect_display_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, p
proto_tree_add_item_ret_string(display_tree, hf_edp_display_string, tvb, offset, length,
ENC_ASCII, wmem_packet_scope(), &display_name);
proto_item_append_text(display_item, ": \"%s\"",
- format_text(display_name, strlen(display_name)));
+ format_text_wmem(wmem_packet_scope(), display_name, strlen(display_name)));
}
static int
@@ -609,7 +609,7 @@ dissect_vlan_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, prot
proto_tree_add_item_ret_string(vlan_tree, hf_edp_vlan_name, tvb, offset, length,
ENC_ASCII, wmem_packet_scope(), &vlan_name);
proto_item_append_text(vlan_item, ", Name \"%s\"",
- format_text(vlan_name, strlen(vlan_name)));
+ format_text_wmem(wmem_packet_scope(), vlan_name, strlen(vlan_name)));
offset += length;
diff --git a/epan/dissectors/packet-foundry.c b/epan/dissectors/packet-foundry.c
index 9da0111684..b1bc047751 100644
--- a/epan/dissectors/packet-foundry.c
+++ b/epan/dissectors/packet-foundry.c
@@ -151,7 +151,7 @@ dissect_string_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, pr
proto_tree_add_item(string_tree, hf_fdp_string_data, tvb, offset, length, ENC_NA);
proto_tree_add_item_ret_string(string_tree, hf_fdp_string_text, tvb, offset, length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &string_value);
proto_item_append_text(string_item, ": \"%s\"",
- format_text(string_value, strlen(string_value)));
+ format_text_wmem(wmem_packet_scope(), string_value, strlen(string_value)));
return offset;
}
diff --git a/epan/dissectors/packet-ftp.c b/epan/dissectors/packet-ftp.c
index 62892e0e3b..5e47f3217a 100644
--- a/epan/dissectors/packet-ftp.c
+++ b/epan/dissectors/packet-ftp.c
@@ -582,7 +582,7 @@ dissect_ftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
*/
col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s",
is_request ? "Request" : "Response",
- format_text(line, linelen));
+ format_text_wmem(wmem_packet_scope(), line, linelen));
ti = proto_tree_add_item(tree, proto_ftp, tvb, 0, -1, ENC_NA);
ftp_tree = proto_item_add_subtree(ti, ett_ftp);
diff --git a/epan/dissectors/packet-gift.c b/epan/dissectors/packet-gift.c
index 5ac2088c37..a6af7a3b9a 100644
--- a/epan/dissectors/packet-gift.c
+++ b/epan/dissectors/packet-gift.c
@@ -72,7 +72,7 @@ dissect_gift(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
/* set "Info" column text */
col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s",
is_request ? "Request" : "Response",
- format_text(line, linelen));
+ format_text_wmem(wmem_packet_scope(), line, linelen));
/* if tree != NULL, build protocol tree */
if (tree) {
@@ -93,10 +93,10 @@ dissect_gift(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
if (tokenlen != 0) {
if (is_request) {
proto_tree_add_string(cmd_tree, hf_gift_request_cmd, tvb, offset,
- tokenlen, format_text(line, tokenlen));
+ tokenlen, format_text_wmem(wmem_packet_scope(), line, tokenlen));
} else {
proto_tree_add_string(cmd_tree, hf_gift_response_cmd, tvb, offset,
- tokenlen, format_text(line, tokenlen));
+ tokenlen, format_text_wmem(wmem_packet_scope(), line, tokenlen));
}
offset += (gint) (next_token - line);
linelen -= (int) (next_token - line);
@@ -106,10 +106,10 @@ dissect_gift(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
if (linelen != 0) {
if (is_request) {
proto_tree_add_string(cmd_tree, hf_gift_request_arg, tvb, offset,
- linelen, format_text(line, linelen));
+ linelen, format_text_wmem(wmem_packet_scope(), line, linelen));
} else {
proto_tree_add_string(cmd_tree, hf_gift_response_arg, tvb, offset,
- linelen, format_text(line, linelen));
+ linelen, format_text_wmem(wmem_packet_scope(), line, linelen));
}
}
}
diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c
index b2b1c00cc3..bd731816e6 100644
--- a/epan/dissectors/packet-giop.c
+++ b/epan/dissectors/packet-giop.c
@@ -4375,7 +4375,7 @@ dissect_giop_request_1_1 (tvbuff_t * tvb, packet_info * pinfo,
if ( len > 0)
{
- col_append_fstr(pinfo->cinfo, COL_INFO, ": op=%s", format_text(operation, (size_t)len));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ": op=%s", format_text_wmem(wmem_packet_scope(), operation, (size_t)len));
proto_tree_add_string(request_tree, hf_giop_req_operation, tvb, offset - len, len, operation);
}
@@ -4498,7 +4498,7 @@ dissect_giop_request_1_2 (tvbuff_t * tvb, packet_info * pinfo,
if ( len > 0)
{
- col_append_fstr(pinfo->cinfo, COL_INFO, ": op=%s", format_text(operation, (size_t)len));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ": op=%s", format_text_wmem(wmem_packet_scope(), operation, (size_t)len));
proto_tree_add_string(request_tree, hf_giop_req_operation, tvb, offset - len, len, operation);
}
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index 7118f451e4..4573192a14 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -879,7 +879,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
* Put the first line from the buffer into the summary
* (but leave out the line terminator).
*/
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", format_text(firstline, first_linelen));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", format_text_wmem(wmem_packet_scope(), firstline, first_linelen));
/*
* Do header desegmentation if we've been told to,
@@ -2669,9 +2669,9 @@ process_header(tvbuff_t *tvb, int offset, int next_offset,
tvb, offset, len,
ENC_NA|ENC_ASCII);
proto_item_set_text(it, "%s",
- format_text(line, len));
+ format_text_wmem(wmem_packet_scope(), line, len));
} else {
- gchar* str = format_text(line, len);
+ gchar* str = format_text_wmem(wmem_packet_scope(), line, len);
proto_tree_add_string_format(tree, hf_http_unknown_header, tvb, offset,
len, str, "%s", str);
}
@@ -2679,7 +2679,7 @@ process_header(tvbuff_t *tvb, int offset, int next_offset,
} else {
proto_tree_add_string_format(tree,
*hf_id, tvb, offset, len,
- value, "%s", format_text(line, len));
+ value, "%s", format_text_wmem(wmem_packet_scope(), line, len));
if (http_type == HTTP_REQUEST ||
http_type == HTTP_RESPONSE) {
it = proto_tree_add_item(tree,
@@ -2689,7 +2689,7 @@ process_header(tvbuff_t *tvb, int offset, int next_offset,
tvb, offset, len,
ENC_NA|ENC_ASCII);
proto_item_set_text(it, "%s",
- format_text(line, len));
+ format_text_wmem(wmem_packet_scope(), line, len));
PROTO_ITEM_SET_HIDDEN(it);
}
}
@@ -2730,7 +2730,7 @@ process_header(tvbuff_t *tvb, int offset, int next_offset,
default:
hdr_item = proto_tree_add_string_format(tree,
*headers[hf_index].hf, tvb, offset, len,
- value, "%s", format_text(line, len));
+ value, "%s", format_text_wmem(wmem_packet_scope(), line, len));
if (http_type == HTTP_REQUEST ||
http_type == HTTP_RESPONSE) {
it = proto_tree_add_item(tree,
@@ -2740,7 +2740,7 @@ process_header(tvbuff_t *tvb, int offset, int next_offset,
tvb, offset, len,
ENC_NA|ENC_ASCII);
proto_item_set_text(it, "%s",
- format_text(line, len));
+ format_text_wmem(wmem_packet_scope(), line, len));
PROTO_ITEM_SET_HIDDEN(it);
}
}
diff --git a/epan/dissectors/packet-icap.c b/epan/dissectors/packet-icap.c
index 5ee8d5d571..305476958b 100644
--- a/epan/dissectors/packet-icap.c
+++ b/epan/dissectors/packet-icap.c
@@ -86,7 +86,7 @@ dissect_icap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
icap_type = ICAP_OTHER; /* type not known yet */
if (is_icap_message(line, linelen, &icap_type))
col_add_str(pinfo->cinfo, COL_INFO,
- format_text(line, linelen));
+ format_text_wmem(wmem_packet_scope(), line, linelen));
else
col_set_str(pinfo->cinfo, COL_INFO, "Continuation");
diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c
index 45e85a48d0..99664dd553 100644
--- a/epan/dissectors/packet-icmpv6.c
+++ b/epan/dissectors/packet-icmpv6.c
@@ -2290,7 +2290,7 @@ dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree
break;
}
used_bytes = get_dns_name(tvb, opt_offset, 0, opt_offset, &dnssl_name, &dnssl_len);
- proto_tree_add_string(icmp6opt_tree, hf_icmpv6_opt_dnssl, tvb, opt_offset, used_bytes, format_text(dnssl_name, dnssl_len));
+ proto_tree_add_string(icmp6opt_tree, hf_icmpv6_opt_dnssl, tvb, opt_offset, used_bytes, format_text_wmem(wmem_packet_scope(), dnssl_name, dnssl_len));
proto_item_append_text(ti, " %s", dnssl_name);
opt_offset += used_bytes;
@@ -3435,7 +3435,7 @@ dissect_nodeinfo(tvbuff_t *tvb, int ni_offset, packet_info *pinfo _U_, proto_tre
const guchar *fqdn_name;
used_bytes = get_dns_name(tvb, ni_offset, 0, ni_offset, &fqdn_name, &fqdn_len);
proto_tree_add_string(tree, hf_icmpv6_ni_query_subject_fqdn, tvb, ni_offset, used_bytes,
- format_text(fqdn_name, fqdn_len));
+ format_text_wmem(wmem_packet_scope(), fqdn_name, fqdn_len));
ni_offset += fqdn_len;
break;
}
@@ -3467,7 +3467,7 @@ dissect_nodeinfo(tvbuff_t *tvb, int ni_offset, packet_info *pinfo _U_, proto_tre
/* Node Name */
used_bytes = get_dns_name(tvb, ni_offset, 0, ni_offset, &node_name, &node_name_len);
proto_tree_add_string(tree, hf_icmpv6_ni_reply_node_name, tvb, ni_offset, used_bytes,
- format_text(node_name, node_name_len));
+ format_text_wmem(wmem_packet_scope(), node_name, node_name_len));
ni_offset += used_bytes;
}
break;
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index a0b8ee1a0d..91c441350f 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -11406,7 +11406,7 @@ dissect_ssid_list(proto_tree *tree, tvbuff_t *tvb, int offset, guint32 tag_len)
if (offset + 2 + len > end)
break;
- str = format_text(tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 2, len, ENC_ASCII), len);
+ str = tvb_format_text(tvb, offset + 2, len);
proto_item_append_text(tree, "%c %s", (first ? ':' : ','), str);
first = FALSE;
entry = proto_tree_add_subtree_format(tree, tvb, offset, 2 + len, ett_ssid_list, NULL, "SSID: %s", str);
@@ -13470,9 +13470,10 @@ ieee80211_tag_ssid(packet_info *pinfo, proto_tree *tree,
ENC_ASCII|ENC_NA);
if (ssid_len > 0) {
- proto_item_append_text(ti, ": %s", format_text(ssid, ssid_len));
+ gchar* s = format_text_wmem(wmem_packet_scope(), ssid, ssid_len);
+ proto_item_append_text(ti, ": %s", s);
- col_append_fstr(pinfo->cinfo, COL_INFO, ", SSID=%s", format_text(ssid, ssid_len));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", SSID=%s", s);
/* Wlan Stats */
memcpy(wlan_stats.ssid, ssid, MIN(ssid_len, MAX_SSID_LEN));
@@ -15509,8 +15510,9 @@ add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset
proto_tree_add_item_ret_string(tree, hf_ieee80211_mesh_id, tvb, offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &mesh_id);
if (tag_len > 0) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", MESHID=%s", format_text(mesh_id, tag_len));
- proto_item_append_text(ti, ": %s", format_text(mesh_id, tag_len));
+ gchar* s = format_text_wmem(wmem_packet_scope(), mesh_id, tag_len);
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", MESHID=%s", s);
+ proto_item_append_text(ti, ": %s", s);
}
break;
diff --git a/epan/dissectors/packet-imap.c b/epan/dissectors/packet-imap.c
index b49a5aed51..8faabf4586 100644
--- a/epan/dissectors/packet-imap.c
+++ b/epan/dissectors/packet-imap.c
@@ -171,7 +171,7 @@ dissect_imap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE);
line = tvb_get_ptr(tvb, offset, linelen);
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", is_request ? "Request" : "Response", format_text(line, linelen));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", is_request ? "Request" : "Response", format_text_wmem(wmem_packet_scope(), line, linelen));
{
ti = proto_tree_add_item(tree, proto_imap, tvb, offset, -1, ENC_NA);
diff --git a/epan/dissectors/packet-kismet.c b/epan/dissectors/packet-kismet.c
index 71affab10e..aa6080ae88 100644
--- a/epan/dissectors/packet-kismet.c
+++ b/epan/dissectors/packet-kismet.c
@@ -126,7 +126,7 @@ dissect_kismet(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * da
else
col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s",
is_request ? "Request" : "Response",
- format_text(line, linelen));
+ format_text_wmem(wmem_packet_scope(), line, linelen));
if (tree) {
ti = proto_tree_add_item(tree, proto_kismet, tvb, offset, -1, ENC_NA);
@@ -183,42 +183,42 @@ dissect_kismet(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * da
line = next_token;
tokenlen = get_token_len(line, line + linelen, &next_token);
proto_tree_add_string(reqresp_tree, hf_kismet_version, tvb, offset,
- tokenlen, format_text(line, tokenlen));
+ tokenlen, format_text_wmem(wmem_packet_scope(), line, tokenlen));
offset += (gint) (next_token - line);
linelen -= (int) (next_token - line);
line = next_token;
tokenlen = get_token_len(line, line + linelen, &next_token);
proto_tree_add_string(reqresp_tree, hf_kismet_start_time, tvb, offset,
- tokenlen, format_text(line, tokenlen));
+ tokenlen, format_text_wmem(wmem_packet_scope(), line, tokenlen));
offset += (gint) (next_token - line);
linelen -= (int) (next_token - line);
line = next_token;
tokenlen = get_token_len(line, line + linelen, &next_token);
proto_tree_add_string(reqresp_tree, hf_kismet_server_name, tvb, offset,
- tokenlen, format_text(line + 1, tokenlen - 2));
+ tokenlen, format_text_wmem(wmem_packet_scope(), line + 1, tokenlen - 2));
offset += (gint) (next_token - line);
linelen -= (int) (next_token - line);
line = next_token;
tokenlen = get_token_len(line, line + linelen, &next_token);
proto_tree_add_string(reqresp_tree, hf_kismet_build_revision, tvb, offset,
- tokenlen, format_text(line, tokenlen));
+ tokenlen, format_text_wmem(wmem_packet_scope(), line, tokenlen));
offset += (gint) (next_token - line);
linelen -= (int) (next_token - line);
line = next_token;
tokenlen = get_token_len(line, line + linelen, &next_token);
proto_tree_add_string(reqresp_tree, hf_kismet_unknown_field, tvb, offset,
- tokenlen, format_text(line, tokenlen));
+ tokenlen, format_text_wmem(wmem_packet_scope(), line, tokenlen));
offset += (gint) (next_token - line);
linelen -= (int) (next_token - line);
line = next_token;
tokenlen = get_token_len(line, line + linelen, &next_token);
proto_tree_add_string(reqresp_tree, hf_kismet_extended_version_string, tvb, offset,
- tokenlen, format_text(line, tokenlen));
+ tokenlen, format_text_wmem(wmem_packet_scope(), line, tokenlen));
}
/*
* *TIME: {Time}
@@ -236,7 +236,7 @@ dissect_kismet(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * da
tokenlen = get_token_len(line, line + linelen, &next_token);
/* Convert form ascii to nstime */
- if (ws_strtou64(format_text(line, tokenlen), NULL, (guint64*)&t.secs)) {
+ if (ws_strtou64(format_text_wmem(wmem_packet_scope(), line, tokenlen), NULL, (guint64*)&t.secs)) {
/*
* Format ascii representation of time
diff --git a/epan/dissectors/packet-lwres.c b/epan/dissectors/packet-lwres.c
index d72ddc02c1..b0f7d354c9 100644
--- a/epan/dissectors/packet-lwres.c
+++ b/epan/dissectors/packet-lwres.c
@@ -530,7 +530,7 @@ static void dissect_srv_records(tvbuff_t* tvb, proto_tree* tree,guint32 nrec,int
tvb,
curr + 8,
used_bytes,
- format_text(dname, dlen));
+ format_text_wmem(wmem_packet_scope(), dname, dlen));
curr+=(int)((sizeof(short)*4) + used_bytes);
@@ -580,7 +580,7 @@ static void dissect_mx_records(tvbuff_t* tvb, proto_tree* tree, guint32 nrec, in
tvb,
curr + 4,
used_bytes,
- format_text(dname, dlen));
+ format_text_wmem(wmem_packet_scope(), dname, dlen));
curr+=(int)((sizeof(short)*2) + used_bytes);
@@ -619,7 +619,7 @@ static void dissect_ns_records(tvbuff_t* tvb, proto_tree* tree, guint32 nrec, in
tvb,
curr + 2,
used_bytes,
- format_text(dname, dlen));
+ format_text_wmem(wmem_packet_scope(), dname, dlen));
curr+=(int)(sizeof(short) + used_bytes);
}
diff --git a/epan/dissectors/packet-memcache.c b/epan/dissectors/packet-memcache.c
index 3e61cbab18..f0ac30f83a 100644
--- a/epan/dissectors/packet-memcache.c
+++ b/epan/dissectors/packet-memcache.c
@@ -859,7 +859,7 @@ dissect_memcache_message (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_t
if (is_request_or_reply) {
line = tvb_get_ptr (tvb, offset, first_linelen);
col_add_fstr (pinfo->cinfo, COL_INFO, "%s ",
- format_text (line, first_linelen));
+ format_text_wmem(wmem_packet_scope(), line, first_linelen));
} else {
col_set_str (pinfo->cinfo, COL_INFO, "MEMCACHE Continuation");
}
diff --git a/epan/dissectors/packet-mmse.c b/epan/dissectors/packet-mmse.c
index 561d1e1541..50cad0e46f 100644
--- a/epan/dissectors/packet-mmse.c
+++ b/epan/dissectors/packet-mmse.c
@@ -1164,7 +1164,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut,
hf_mmse_prev_sent_by,
tvb, offset - 1, 1 + count + length,
strval, "%s (Forwarded-count=%u)",
- format_text(strval, strlen(strval)),
+ format_text_wmem(wmem_packet_scope(), strval, strlen(strval)),
fwd_count);
subtree = proto_item_add_subtree(tii,
ett_mmse_hdr_details);
@@ -1201,7 +1201,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut,
hf_mmse_prev_sent_date,
tvb, offset - 1, 1 + count + length,
strval, "%s (Forwarded-count=%u)",
- format_text(strval, strlen(strval)),
+ format_text_wmem(wmem_packet_scope(), strval, strlen(strval)),
fwd_count);
subtree = proto_item_add_subtree(tii,
ett_mmse_hdr_details);
@@ -1238,7 +1238,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut,
} else if ((peek == 0) || (peek >= 0x20)) { /* Text */
length = get_text_string(tvb, offset, &strval);
if (tree) {
- str = format_text(strval, strlen(strval));
+ str = format_text_wmem(wmem_packet_scope(), strval, strlen(strval));
proto_tree_add_string_format(mmse_tree, hf_mmse_header_string, tvb, offset - 1,
length + 1, str, "%s: %s (Not decoded)", hdr_name, str);
}
@@ -1276,8 +1276,8 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut,
tvb_get_string_enc(wmem_packet_scope(), tvb, offset,
length + length2, ENC_ASCII),
"%s: %s",
- format_text(strval, strlen(strval)),
- format_text(strval2, strlen(strval2)));
+ format_text_wmem(wmem_packet_scope(), strval, strlen(strval)),
+ format_text_wmem(wmem_packet_scope(), strval2, strlen(strval2)));
}
offset += length + length2;
}
diff --git a/epan/dissectors/packet-ms-mms.c b/epan/dissectors/packet-ms-mms.c
index 447ced8888..6fc8a9d456 100644
--- a/epan/dissectors/packet-ms-mms.c
+++ b/epan/dissectors/packet-ms-mms.c
@@ -751,7 +751,7 @@ static void dissect_client_transport_info(tvbuff_t *tvb, packet_info *pinfo, pro
transport_info, "Transport: (%s)", transport_info);
col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
- format_text((guchar*)transport_info, length_remaining - 20));
+ format_text_wmem(wmem_packet_scope(), (guchar*)transport_info, length_remaining - 20));
/* Try to extract details from this string */
@@ -848,7 +848,7 @@ static void dissect_server_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
ENC_UTF_16|ENC_LITTLE_ENDIAN, wmem_packet_scope(), &server_version);
col_append_fstr(pinfo->cinfo, COL_INFO, " (version='%s')",
- format_text((guchar*)server_version, strlen(server_version)));
+ format_text_wmem(wmem_packet_scope(), (guchar*)server_version, strlen(server_version)));
}
offset += (server_version_length*2);
@@ -902,7 +902,7 @@ static void dissect_client_player_info(tvbuff_t *tvb, packet_info *pinfo, proto_
ENC_UTF_16|ENC_LITTLE_ENDIAN, wmem_packet_scope(), &player_info);
col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
- format_text((guchar*)player_info, strlen(player_info)));
+ format_text_wmem(wmem_packet_scope(), (guchar*)player_info, strlen(player_info)));
}
/* Dissect info about where client wants to start playing from */
@@ -977,7 +977,7 @@ static void dissect_request_server_file(tvbuff_t *tvb, packet_info *pinfo, proto
ENC_UTF_16|ENC_LITTLE_ENDIAN, wmem_packet_scope(), &server_file);
col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
- format_text((guchar*)server_file, strlen(server_file)));
+ format_text_wmem(wmem_packet_scope(), (guchar*)server_file, strlen(server_file)));
}
/* Dissect media details from server */
diff --git a/epan/dissectors/packet-msn-messenger.c b/epan/dissectors/packet-msn-messenger.c
index 22b60560cb..5f833deaec 100644
--- a/epan/dissectors/packet-msn-messenger.c
+++ b/epan/dissectors/packet-msn-messenger.c
@@ -88,7 +88,7 @@ dissect_msnms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U
* Put the first line from the buffer into the summary.
*/
col_add_str(pinfo->cinfo, COL_INFO,
- format_text(line, linelen));
+ format_text_wmem(wmem_packet_scope(), line, linelen));
if (tree) {
ti = proto_tree_add_item(tree, proto_msnms, tvb, offset, -1,
diff --git a/epan/dissectors/packet-ndps.c b/epan/dissectors/packet-ndps.c
index d2cac74317..a498c7a006 100644
--- a/epan/dissectors/packet-ndps.c
+++ b/epan/dissectors/packet-ndps.c
@@ -2629,7 +2629,7 @@ server_entry(tvbuff_t* tvb, packet_info* pinfo, proto_tree *ndps_tree, int foffs
atree = proto_tree_add_subtree(ndps_tree, tvb, foffset, -1, ett_ndps, &aitem, "Server Info");
foffset = ndps_string(tvb, hf_ndps_server_name, ndps_tree, foffset, &server_name);
- proto_item_append_text(aitem, ": %s", format_text(server_name, strlen(server_name)));
+ proto_item_append_text(aitem, ": %s", format_text_wmem(wmem_packet_scope(), server_name, strlen(server_name)));
proto_tree_add_item(atree, hf_ndps_server_type, tvb, foffset, 4, ENC_BIG_ENDIAN);
foffset += 4;
foffset = print_address(tvb, atree, foffset);
diff --git a/epan/dissectors/packet-pop.c b/epan/dissectors/packet-pop.c
index 9f67558940..54185d86db 100644
--- a/epan/dissectors/packet-pop.c
+++ b/epan/dissectors/packet-pop.c
@@ -192,7 +192,7 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
}
else
col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", is_request ? "C" : "S",
- format_text(line, linelen));
+ format_text_wmem(wmem_packet_scope(), line, linelen));
ti = proto_tree_add_item(tree, proto_pop, tvb, offset, -1, ENC_NA);
pop_tree = proto_item_add_subtree(ti, ett_pop);
diff --git a/epan/dissectors/packet-pvfs2.c b/epan/dissectors/packet-pvfs2.c
index 462af09a39..be9e09e98f 100644
--- a/epan/dissectors/packet-pvfs2.c
+++ b/epan/dissectors/packet-pvfs2.c
@@ -893,7 +893,7 @@ dissect_pvfs_opaque_data(tvbuff_t *tvb, int offset,
size_t string_buffer_size = 0;
char *string_buffer_temp;
- formatted = format_text((guint8 *)string_buffer,
+ formatted = format_text_wmem(wmem_packet_scope(), (guint8 *)string_buffer,
(int)strlen(string_buffer));
string_buffer_size = strlen(formatted) + 12 + 1;
@@ -917,9 +917,8 @@ dissect_pvfs_opaque_data(tvbuff_t *tvb, int offset,
}
} else {
if (string_data) {
- string_buffer_print =
- wmem_strdup(wmem_packet_scope(), format_text((guint8 *) string_buffer,
- (int)strlen(string_buffer)));
+ string_buffer_print = format_text_wmem(wmem_packet_scope(), (guint8 *) string_buffer,
+ (int)strlen(string_buffer));
} else {
string_buffer_print="<DATA>";
}
diff --git a/epan/dissectors/packet-rdp.c b/epan/dissectors/packet-rdp.c
index 535b6f147b..ea7098e3e3 100644
--- a/epan/dissectors/packet-rdp.c
+++ b/epan/dissectors/packet-rdp.c
@@ -2157,7 +2157,7 @@ dissect_rdp_cr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
linelen, ENC_ASCII|ENC_NA,
wmem_packet_scope(), &stringval);
offset = (linelen == -1) ? (gint)tvb_captured_length(tvb) : next_offset;
- col_append_str(pinfo->cinfo, COL_INFO, format_text(stringval, strlen(stringval)));
+ col_append_str(pinfo->cinfo, COL_INFO, format_text_wmem(wmem_packet_scope(), stringval, strlen(stringval)));
sep = ", ";
}
/*
diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c
index be933d07d7..571cb1d751 100644
--- a/epan/dissectors/packet-rpc.c
+++ b/epan/dissectors/packet-rpc.c
@@ -798,7 +798,7 @@ dissect_rpc_opaque_data(tvbuff_t *tvb, int offset,
if (string_data) {
char *formatted;
- formatted = format_text(string_buffer, strlen(string_buffer));
+ formatted = format_text_wmem(wmem_packet_scope(), string_buffer, strlen(string_buffer));
/* copy over the data and append <TRUNCATED> */
string_buffer_print=wmem_strdup_printf(wmem_packet_scope(), "%s%s", formatted, RPC_STRING_TRUNCATED);
} else {
@@ -806,8 +806,7 @@ dissect_rpc_opaque_data(tvbuff_t *tvb, int offset,
}
} else {
if (string_data) {
- string_buffer_print =
- wmem_strdup(wmem_packet_scope(), format_text(string_buffer, strlen(string_buffer)));
+ string_buffer_print = format_text_wmem(wmem_packet_scope(), string_buffer, strlen(string_buffer));
} else {
string_buffer_print=RPC_STRING_DATA;
}
diff --git a/epan/dissectors/packet-rtsp.c b/epan/dissectors/packet-rtsp.c
index 8a4c167f7c..7eb110124a 100644
--- a/epan/dissectors/packet-rtsp.c
+++ b/epan/dissectors/packet-rtsp.c
@@ -894,11 +894,10 @@ dissect_rtspmessage(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (is_request_or_reply) {
if ( rtsp_type_packet == RTSP_REPLY ) {
frame_label = wmem_strdup_printf(wmem_packet_scope(),
- "Reply: %s", format_text(line, first_linelen));
+ "Reply: %s", format_text_wmem(wmem_packet_scope(), line, first_linelen));
}
else {
- frame_label = wmem_strdup(wmem_packet_scope(),
- format_text(line, first_linelen));
+ frame_label = format_text_wmem(wmem_packet_scope(), line, first_linelen);
}
}
@@ -917,11 +916,11 @@ dissect_rtspmessage(tvbuff_t *tvb, int offset, packet_info *pinfo,
if ( rtsp_type_packet == RTSP_REPLY ) {
col_set_str(pinfo->cinfo, COL_INFO, "Reply: ");
col_append_str(pinfo->cinfo, COL_INFO,
- format_text(line, first_linelen));
+ format_text_wmem(wmem_packet_scope(), line, first_linelen));
}
else {
col_add_str(pinfo->cinfo, COL_INFO,
- format_text(line, first_linelen));
+ format_text_wmem(wmem_packet_scope(), line, first_linelen));
}
else
diff --git a/epan/dissectors/packet-sigcomp.c b/epan/dissectors/packet-sigcomp.c
index 321f17ba1d..68a267302b 100644
--- a/epan/dissectors/packet-sigcomp.c
+++ b/epan/dissectors/packet-sigcomp.c
@@ -4105,7 +4105,7 @@ execute_next_instruction:
if (print_level_3 ) {
proto_tree_add_uint_format(udvm_tree, hf_sigcomp_state_value, bytecode_tvb, 0, 0, buff[k],
" Addr: %5u State value: %u (0x%x) ASCII(%s)",
- k,buff[k],buff[k],format_text(string, 1));
+ k,buff[k],buff[k],format_text_wmem(wmem_packet_scope(), string, 1));
}
k = ( k + 1 ) & 0xffff;
n++;
@@ -4226,7 +4226,7 @@ execute_next_instruction:
if (print_level_3 ) {
proto_tree_add_uint_format(udvm_tree, hf_sigcomp_output_value, bytecode_tvb, 0, -1, buff[k],
" Output value: %u (0x%x) ASCII(%s) from Addr: %u ,output to dispatcher position %u",
- buff[k],buff[k],format_text(string,1), k,output_address);
+ buff[k],buff[k],format_text_wmem(wmem_packet_scope(), string,1), k,output_address);
}
k = ( k + 1 ) & 0xffff;
output_address ++;
diff --git a/epan/dissectors/packet-slsk.c b/epan/dissectors/packet-slsk.c
index e0aa8acf53..6b095adc9b 100644
--- a/epan/dissectors/packet-slsk.c
+++ b/epan/dissectors/packet-slsk.c
@@ -968,7 +968,7 @@ static int dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, len, ENC_ASCII);
proto_tree_add_string_format_value(slsk_tree, hf_slsk_connection_type, tvb, offset+4, len, str,
"%s (Char: %s)", connection_type(str),
- format_text(str, len));
+ format_text_wmem(wmem_packet_scope(), str, len));
offset += 4+len;
}
else if (check_slsk_format(tvb, offset, "issiii")) {
@@ -988,7 +988,7 @@ static int dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, len, ENC_ASCII);
proto_tree_add_string_format_value(slsk_tree, hf_slsk_connection_type, tvb, offset+4, len, str,
"%s (Char: %s)", connection_type(str),
- format_text(str, len));
+ format_text_wmem(wmem_packet_scope(), str, len));
offset += 4+len;
proto_tree_add_item(slsk_tree, hf_slsk_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
@@ -2338,7 +2338,7 @@ static int dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, len, ENC_ASCII);
proto_tree_add_string_format_value(slsk_tree, hf_slsk_connection_type, tvb, offset+4, len, str,
"%s (Char: %s)", connection_type(str),
- format_text(str, len));
+ format_text_wmem(wmem_packet_scope(), str, len));
offset += 4+len;
proto_tree_add_uint(slsk_tree, hf_slsk_token, tvb, offset, 4, tvb_get_letohl(tvb, offset));
offset += 4;
diff --git a/epan/dissectors/packet-smb-common.c b/epan/dissectors/packet-smb-common.c
index aad6cf251f..0a202f013a 100644
--- a/epan/dissectors/packet-smb-common.c
+++ b/epan/dissectors/packet-smb-common.c
@@ -131,7 +131,7 @@ int dissect_ms_compressed_string(tvbuff_t *tvb, proto_tree *tree, int offset, in
/* The name data MUST start at offset 0 of the tvb */
compr_len = get_dns_name(tvb, offset, MAX_UNICODE_STR_LEN+3+1, 0, &str, &str_len);
- proto_tree_add_string(tree, hf_index, tvb, offset, compr_len, format_text(str, str_len));
+ proto_tree_add_string(tree, hf_index, tvb, offset, compr_len, format_text_wmem(wmem_packet_scope(), str, str_len));
if (data)
*data = str;
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c
index 09cc57ab9b..a37057a6f2 100644
--- a/epan/dissectors/packet-smb.c
+++ b/epan/dissectors/packet-smb.c
@@ -3071,7 +3071,7 @@ dissect_old_dir_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
COUNT_BYTES(dn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Directory: %s",
- format_text(dn, strlen(dn)));
+ format_text_wmem(wmem_packet_scope(), dn, strlen(dn)));
END_OF_SMB
@@ -3210,7 +3210,7 @@ dissect_tree_connect_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
COUNT_BYTES(an_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(an, strlen(an)));
+ format_text_wmem(wmem_packet_scope(), an, strlen(an)));
/* buffer format */
CHECK_BYTE_COUNT(1);
@@ -3492,11 +3492,11 @@ dissect_move_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
if (fn == NULL)
goto endofcommand;
proto_tree_add_string_format(tree, hf_smb_file_name, tvb, offset,
- fn_len, fn, "Old File Name: %s", format_text(fn, strlen(fn)));
+ fn_len, fn, "Old File Name: %s", format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
COUNT_BYTES(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Old Name: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
/* buffer format */
CHECK_BYTE_COUNT(1);
@@ -3509,11 +3509,11 @@ dissect_move_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
if (fn == NULL)
goto endofcommand;
proto_tree_add_string_format(tree, hf_smb_file_name, tvb, offset,
- fn_len, fn, "New File Name: %s", format_text(fn, strlen(fn)));
+ fn_len, fn, "New File Name: %s", format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
COUNT_BYTES(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", New Name: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
END_OF_SMB
@@ -3556,11 +3556,11 @@ dissect_copy_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
if (fn == NULL)
goto endofcommand;
proto_tree_add_string_format(tree, hf_smb_file_name, tvb, offset,
- fn_len, fn, "Source File Name: %s", format_text(fn, strlen(fn)));
+ fn_len, fn, "Source File Name: %s", format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
COUNT_BYTES(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Source Name: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
/* buffer format */
CHECK_BYTE_COUNT(1);
@@ -3574,10 +3574,10 @@ dissect_copy_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
goto endofcommand;
proto_tree_add_string_format(tree, hf_smb_file_name, tvb, offset,
fn_len, fn, "Destination File Name: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
COUNT_BYTES(fn_len);
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Destination Name: %s", format_text(fn, strlen(fn)));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Destination Name: %s", format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
END_OF_SMB
@@ -3668,7 +3668,7 @@ dissect_open_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
}
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
END_OF_SMB
@@ -4231,7 +4231,7 @@ dissect_create_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
END_OF_SMB
@@ -4299,7 +4299,7 @@ dissect_delete_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
COUNT_BYTES(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
END_OF_SMB
@@ -4340,7 +4340,7 @@ dissect_rename_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
COUNT_BYTES(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Old Name: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
/* buffer format */
CHECK_BYTE_COUNT(1);
@@ -4358,7 +4358,7 @@ dissect_rename_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
COUNT_BYTES(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", New Name: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
END_OF_SMB
@@ -4413,7 +4413,7 @@ dissect_nt_rename_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
COUNT_BYTES(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Old Name: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
/* buffer format */
CHECK_BYTE_COUNT(1);
@@ -4430,7 +4430,7 @@ dissect_nt_rename_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
COUNT_BYTES(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", New Name: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
END_OF_SMB
@@ -4467,7 +4467,7 @@ dissect_query_information_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
COUNT_BYTES(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
END_OF_SMB
@@ -4542,7 +4542,7 @@ dissect_set_information_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
COUNT_BYTES(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
END_OF_SMB
@@ -4987,7 +4987,7 @@ dissect_create_temporary_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
COUNT_BYTES(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
END_OF_SMB
@@ -5814,7 +5814,7 @@ dissect_search_find_request(tvbuff_t *tvb, packet_info *pinfo,
COUNT_BYTES(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", File: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
/* buffer format */
CHECK_BYTE_COUNT(1);
@@ -6513,7 +6513,7 @@ dissect_open_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
}
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
END_OF_SMB
@@ -7608,8 +7608,8 @@ dissect_session_setup_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
else
col_append_fstr(pinfo->cinfo, COL_INFO,
"%s\\%s",
- format_text(dn, strlen(dn)),
- format_text(an, strlen(an)));
+ format_text_wmem(wmem_packet_scope(), dn, strlen(dn)),
+ format_text_wmem(wmem_packet_scope(), an, strlen(an)));
/* OS */
an = get_unicode_or_ascii_string(tvb, &offset,
@@ -7967,7 +7967,7 @@ dissect_tree_connect_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
}
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(an, strlen(an)));
+ format_text_wmem(wmem_packet_scope(), an, strlen(an)));
/*
* NOTE: the Service string is always ASCII, even if the
@@ -10442,7 +10442,7 @@ dissect_nt_create_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
}
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
END_OF_SMB
@@ -11060,7 +11060,7 @@ dissect_get_dfs_request_data(tvbuff_t *tvb, packet_info *pinfo,
COUNT_BYTES_TRANS(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", File: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
*bcp = bc;
return offset;
@@ -11140,7 +11140,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo,
COUNT_BYTES_TRANS(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
break;
case 0x0001: /*TRANS2_FIND_FIRST2*/
/* Search Attributes */
@@ -11182,7 +11182,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo,
COUNT_BYTES_TRANS(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Pattern: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
break;
case 0x0002: /*TRANS2_FIND_NEXT2*/
@@ -11222,7 +11222,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo,
COUNT_BYTES_TRANS(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Continue: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
break;
case 0x0003: /*TRANS2_QUERY_FS_INFORMATION*/
@@ -11284,7 +11284,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo,
}
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
break;
case 0x0006: /*TRANS2_SET_PATH_INFORMATION*/
@@ -11309,7 +11309,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo,
COUNT_BYTES_TRANS(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
break;
case 0x0007: { /*TRANS2_QUERY_FILE_INFORMATION*/
@@ -11435,7 +11435,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo,
COUNT_BYTES_TRANS(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
break;
case 0x000c: /*TRANS2_FIND_NOTIFY_NEXT*/
@@ -11465,7 +11465,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo,
COUNT_BYTES_TRANS(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Dir: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
break;
case 0x000e: /*TRANS2_SESSION_SETUP*/
/* XXX unknown structure*/
@@ -11482,7 +11482,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo,
COUNT_BYTES_TRANS(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, ", File: %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
break;
}
@@ -12161,7 +12161,7 @@ dissect_4_2_16_2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
/* EA name */
name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, name_len, ENC_ASCII);
- proto_item_append_text(item, ": %s", format_text(name, strlen(name)));
+ proto_item_append_text(item, ": %s", format_text_wmem(wmem_packet_scope(), name, strlen(name)));
CHECK_BYTE_COUNT_SUBR(name_len + 1);
proto_tree_add_item(
@@ -12547,7 +12547,7 @@ dissect_qfi_SMB_FILE_STREAM_INFO(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
fn);
COUNT_BYTES_SUBR(fn_len);
- proto_item_append_text(item, ": %s", format_text(fn, strlen(fn)));
+ proto_item_append_text(item, ": %s", format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
proto_item_set_len(item, offset-old_offset);
if (neo == 0)
@@ -14344,9 +14344,9 @@ dissect_4_3_4_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
COUNT_BYTES_SUBR(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
- proto_item_append_text(item, " File: %s", format_text(fn, strlen(fn)));
+ proto_item_append_text(item, " File: %s", format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
proto_item_set_len(item, offset-old_offset);
*trunc = FALSE;
@@ -14455,9 +14455,9 @@ dissect_4_3_4_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
COUNT_BYTES_SUBR(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
- proto_item_append_text(item, " File: %s", format_text(fn, strlen(fn)));
+ proto_item_append_text(item, " File: %s", format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
proto_item_set_len(item, offset-old_offset);
*trunc = FALSE;
@@ -14568,9 +14568,9 @@ dissect_4_3_4_3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
COUNT_BYTES_SUBR(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
- proto_item_append_text(item, " File: %s", format_text(fn, strlen(fn)));
+ proto_item_append_text(item, " File: %s", format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
proto_item_set_len(item, offset-old_offset);
return offset;
@@ -14653,7 +14653,7 @@ dissect_4_3_4_4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
COUNT_BYTES_SUBR(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
/* skip to next structure */
if (neo) {
@@ -14670,7 +14670,7 @@ dissect_4_3_4_4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
}
}
- proto_item_append_text(item, " File: %s", format_text(fn, strlen(fn)));
+ proto_item_append_text(item, " File: %s", format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
proto_item_set_len(item, offset-old_offset);
*trunc = FALSE;
@@ -14760,7 +14760,7 @@ dissect_4_3_4_5(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
COUNT_BYTES_SUBR(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
/* skip to next structure */
if (neo) {
@@ -14777,7 +14777,7 @@ dissect_4_3_4_5(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
}
}
- proto_item_append_text(item, " File: %s", format_text(fn, strlen(fn)));
+ proto_item_append_text(item, " File: %s", format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
proto_item_set_len(item, offset-old_offset);
*trunc = FALSE;
@@ -14893,7 +14893,7 @@ dissect_4_3_4_6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
COUNT_BYTES_SUBR(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
/* skip to next structure */
if (neo) {
@@ -14910,7 +14910,7 @@ dissect_4_3_4_6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
}
}
- proto_item_append_text(item, " File: %s", format_text(fn, strlen(fn)));
+ proto_item_append_text(item, " File: %s", format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
proto_item_set_len(item, offset-old_offset);
*trunc = FALSE;
@@ -15015,7 +15015,7 @@ dissect_4_3_4_6full(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
COUNT_BYTES_SUBR(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
/* skip to next structure */
if (neo) {
@@ -15032,7 +15032,7 @@ dissect_4_3_4_6full(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
}
}
- proto_item_append_text(item, " File: %s", format_text(fn, strlen(fn)));
+ proto_item_append_text(item, " File: %s", format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
proto_item_set_len(item, offset-old_offset);
*trunc = FALSE;
@@ -15158,7 +15158,7 @@ dissect_4_3_4_6_id_both(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr
COUNT_BYTES_SUBR(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
/* skip to next structure */
if (neo) {
@@ -15175,7 +15175,7 @@ dissect_4_3_4_6_id_both(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr
}
}
- proto_item_append_text(item, " File: %s", format_text(fn, strlen(fn)));
+ proto_item_append_text(item, " File: %s", format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
proto_item_set_len(item, offset-old_offset);
*trunc = FALSE;
@@ -15239,7 +15239,7 @@ dissect_4_3_4_7(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
COUNT_BYTES_SUBR(fn_len);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- format_text(fn, strlen(fn)));
+ format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
/* skip to next structure */
if (neo) {
@@ -15256,7 +15256,7 @@ dissect_4_3_4_7(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
}
}
- proto_item_append_text(item, " File: %s", format_text(fn, strlen(fn)));
+ proto_item_append_text(item, " File: %s", format_text_wmem(wmem_packet_scope(), fn, strlen(fn)));
proto_item_set_len(item, offset-old_offset);
*trunc = FALSE;
diff --git a/epan/dissectors/packet-smtp.c b/epan/dissectors/packet-smtp.c
index 6309794ba2..ef3cd2e779 100644
--- a/epan/dissectors/packet-smtp.c
+++ b/epan/dissectors/packet-smtp.c
@@ -332,7 +332,7 @@ decode_plain_auth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_string(tree, hf_smtp_username, tvb,
a_offset, a_linelen, decrypt + length_user1 + 1);
col_append_fstr(pinfo->cinfo, COL_INFO, "User: %s",
- format_text(decrypt + length_user1 + 1, length_user2));
+ format_text_wmem(wmem_packet_scope(), decrypt + length_user1 + 1, length_user2));
if (returncode >= (length_user1 + 1 + length_user2 + 1)) {
length_pass = (gint)strlen(decrypt + length_user1 + length_user2 + 2);
@@ -340,7 +340,7 @@ decode_plain_auth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
a_offset, length_pass, decrypt + length_user1 + length_user2 + 2);
col_append_str(pinfo->cinfo, COL_INFO, " ");
col_append_fstr(pinfo->cinfo, COL_INFO, " Pass: %s",
- format_text(decrypt + length_user1 + length_user2 + 2, length_pass));
+ format_text_wmem(wmem_packet_scope(), decrypt + length_user1 + length_user2 + 2, length_pass));
}
}
}
@@ -349,7 +349,7 @@ decode_plain_auth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
ti = proto_tree_add_item(tree, hf_smtp_username_password, tvb,
a_offset, a_linelen, ENC_ASCII|ENC_NA);
expert_add_info(pinfo, ti, &ei_smtp_base64_decode);
- col_append_str(pinfo->cinfo, COL_INFO, format_text(decrypt, a_linelen));
+ col_append_str(pinfo->cinfo, COL_INFO, format_text_wmem(wmem_packet_scope(), decrypt, a_linelen));
}
}
@@ -837,7 +837,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
}
proto_tree_add_string(smtp_tree, hf_smtp_username, tvb,
loffset, linelen, decrypt);
- col_append_fstr(pinfo->cinfo, COL_INFO, "User: %s", format_text(decrypt, decrypt_len));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "User: %s", format_text_wmem(wmem_packet_scope(), decrypt, decrypt_len));
} else if (session_state->password_frame == pinfo->num) {
if (decrypt == NULL) {
/* This line wasn't already decrypted through the state machine */
@@ -853,7 +853,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
}
proto_tree_add_string(smtp_tree, hf_smtp_password, tvb,
loffset, linelen, decrypt);
- col_append_fstr(pinfo->cinfo, COL_INFO, "Pass: %s", format_text(decrypt, decrypt_len));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "Pass: %s", format_text_wmem(wmem_packet_scope(), decrypt, decrypt_len));
} else if (session_state->ntlm_rsp_frame == pinfo->num) {
decrypt = tvb_get_string_enc(wmem_packet_scope(), tvb, loffset, linelen, ENC_ASCII);
decrypt_len = linelen;
@@ -862,7 +862,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
/* Go back to the original string */
decrypt = tvb_get_string_enc(wmem_packet_scope(), tvb, loffset, linelen, ENC_ASCII);
decrypt_len = linelen;
- col_append_str(pinfo->cinfo, COL_INFO, format_text(decrypt, linelen));
+ col_append_str(pinfo->cinfo, COL_INFO, format_text_wmem(wmem_packet_scope(), decrypt, linelen));
proto_tree_add_item(smtp_tree, hf_smtp_command_line, tvb,
loffset, linelen, ENC_ASCII|ENC_NA);
}
@@ -872,7 +872,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
}
}
else {
- col_append_str(pinfo->cinfo, COL_INFO, format_text(decrypt, linelen));
+ col_append_str(pinfo->cinfo, COL_INFO, format_text_wmem(wmem_packet_scope(), decrypt, linelen));
proto_tree_add_item(smtp_tree, hf_smtp_command_line, tvb,
loffset, linelen, ENC_ASCII|ENC_NA);
}
@@ -914,8 +914,8 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
}
proto_tree_add_string(cmdresp_tree, hf_smtp_username, tvb, loffset + 11, linelen - 11, decrypt);
col_append_str(pinfo->cinfo, COL_INFO,
- format_text(tvb_get_string_enc(wmem_packet_scope(), tvb, loffset, 11, ENC_ASCII), 11));
- col_append_fstr(pinfo->cinfo, COL_INFO, "User: %s", format_text(decrypt, decrypt_len));
+ tvb_format_text(tvb, loffset, 11));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "User: %s", format_text_wmem(wmem_packet_scope(), decrypt, decrypt_len));
}
}
else if ((linelen > 5) && (session_state->ntlm_req_frame == pinfo->num) ) {
@@ -930,20 +930,20 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
decrypt = tvb_get_string_enc(wmem_packet_scope(), tvb, loffset + 10, linelen - 10, ENC_ASCII);
decrypt_len = linelen - 10;
col_append_str(pinfo->cinfo, COL_INFO,
- format_text(tvb_get_string_enc(wmem_packet_scope(), tvb, loffset, 10, ENC_ASCII), 10));
- col_append_str(pinfo->cinfo, COL_INFO, format_text(decrypt, linelen - 10));
+ tvb_format_text(tvb, loffset, 10));
+ col_append_str(pinfo->cinfo, COL_INFO, format_text_wmem(wmem_packet_scope(), decrypt, linelen - 10));
}
else {
base64_string = tvb_get_string_enc(wmem_packet_scope(), tvb, loffset + 10, linelen - 10, ENC_ASCII);
col_append_str(pinfo->cinfo, COL_INFO,
- format_text(tvb_get_string_enc(wmem_packet_scope(), tvb, loffset, 10, ENC_ASCII), linelen - 10));
- dissect_ntlm_auth(tvb, pinfo, cmdresp_tree, format_text(base64_string, linelen - 10));
+ tvb_format_text(tvb, loffset, 10));
+ dissect_ntlm_auth(tvb, pinfo, cmdresp_tree, format_text_wmem(wmem_packet_scope(), base64_string, linelen - 10));
}
}
else {
col_append_str(pinfo->cinfo, COL_INFO,
- format_text(tvb_get_string_enc(wmem_packet_scope(), tvb, loffset, 10, ENC_ASCII), 10));
- col_append_str(pinfo->cinfo, COL_INFO, format_text(decrypt, linelen - 10));
+ tvb_format_text(tvb, loffset, 10));
+ col_append_str(pinfo->cinfo, COL_INFO, format_text_wmem(wmem_packet_scope(), decrypt, linelen - 10));
}
}
}
@@ -951,18 +951,18 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
proto_tree_add_item(cmdresp_tree, hf_smtp_req_parameter, tvb,
loffset + 5, linelen - 5, ENC_ASCII|ENC_NA);
col_append_str(pinfo->cinfo, COL_INFO,
- format_text(tvb_get_string_enc(wmem_packet_scope(), tvb, loffset, 11, ENC_ASCII), 11));
+ tvb_format_text(tvb, loffset, 11));
decode_plain_auth(tvb, pinfo, cmdresp_tree, loffset + 11, linelen - 11);
}
else if (linelen > 5) {
proto_tree_add_item(cmdresp_tree, hf_smtp_req_parameter, tvb,
loffset + 5, linelen - 5, ENC_ASCII|ENC_NA);
col_append_str(pinfo->cinfo, COL_INFO,
- format_text(tvb_get_string_enc(wmem_packet_scope(), tvb, loffset, linelen, ENC_ASCII), linelen));
+ tvb_format_text(tvb, loffset, linelen));
}
else {
col_append_str(pinfo->cinfo, COL_INFO,
- format_text(tvb_get_string_enc(wmem_packet_scope(), tvb, loffset, linelen, ENC_ASCII), linelen));
+ tvb_format_text(tvb, loffset, linelen));
}
if (smtp_data_desegment && !spd_frame_data->more_frags) {
@@ -1120,7 +1120,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
proto_tree_add_string(cmdresp_tree, hf_smtp_rsp_parameter, tvb,
offset + 4, linelen - 4, (const char*)decrypt);
- col_append_fstr(pinfo->cinfo, COL_INFO, "%d %s", code, format_text(decrypt, decrypt_len));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%d %s", code, format_text_wmem(wmem_packet_scope(), decrypt, decrypt_len));
}
} else {
decrypt = NULL;
@@ -1132,11 +1132,11 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
offset + 4, linelen - 4, ENC_ASCII|ENC_NA);
col_append_fstr(pinfo->cinfo, COL_INFO, "%d %s", code,
- format_text(tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 4, linelen - 4, ENC_ASCII), linelen - 4));
+ tvb_format_text(tvb, offset + 4, linelen - 4));
}
} else {
col_append_str(pinfo->cinfo, COL_INFO,
- format_text(tvb_get_string_enc(wmem_packet_scope(), tvb, offset, linelen, ENC_ASCII), linelen));
+ tvb_format_text(tvb, offset, linelen));
}
}
}
diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c
index 1be6c4010a..772f4055e1 100644
--- a/epan/dissectors/packet-snmp.c
+++ b/epan/dissectors/packet-snmp.c
@@ -77,12 +77,6 @@
#include <wsutil/wsgcrypt.h>
-/* Take a pointer that may be null and return a pointer that's not null
- by turning null pointers into pointers to the above null string,
- and, if the argument pointer wasn't null, make sure we handle
- non-printable characters in the string by escaping them. */
-#define SAFE_STRING(s, l) (((s) != NULL) ? format_text((s), (l)) : "")
-
#define PNAME "Simple Network Management Protocol"
#define PSNAME "SNMP"
#define PFNAME "snmp"
@@ -300,7 +294,7 @@ static int hf_snmp_priority = -1; /* INTEGER_M1_2147483647 */
static int hf_snmp_operation = -1; /* T_operation */
/*--- End of included file: packet-snmp-hf.c ---*/
-#line 226 "./asn1/snmp/packet-snmp-template.c"
+#line 220 "./asn1/snmp/packet-snmp-template.c"
/* Initialize the subtree pointers */
static gint ett_smux = -1;
@@ -340,7 +334,7 @@ static gint ett_snmp_SimpleOpen_U = -1;
static gint ett_snmp_RReqPDU_U = -1;
/*--- End of included file: packet-snmp-ett.c ---*/
-#line 242 "./asn1/snmp/packet-snmp-template.c"
+#line 236 "./asn1/snmp/packet-snmp-template.c"
static expert_field ei_snmp_failed_decrypted_data_pdu = EI_INIT;
static expert_field ei_snmp_decrypted_data_bad_formatted = EI_INIT;
@@ -3074,7 +3068,7 @@ static int dissect_SMUX_PDUs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, prot
/*--- End of included file: packet-snmp-fn.c ---*/
-#line 1869 "./asn1/snmp/packet-snmp-template.c"
+#line 1863 "./asn1/snmp/packet-snmp-template.c"
guint
@@ -3891,7 +3885,7 @@ void proto_register_snmp(void) {
NULL, HFILL }},
/*--- End of included file: packet-snmp-hfarr.c ---*/
-#line 2421 "./asn1/snmp/packet-snmp-template.c"
+#line 2415 "./asn1/snmp/packet-snmp-template.c"
};
/* List of subtrees */
@@ -3931,7 +3925,7 @@ void proto_register_snmp(void) {
&ett_snmp_RReqPDU_U,
/*--- End of included file: packet-snmp-ettarr.c ---*/
-#line 2437 "./asn1/snmp/packet-snmp-template.c"
+#line 2431 "./asn1/snmp/packet-snmp-template.c"
};
static ei_register_info ei[] = {
{ &ei_snmp_failed_decrypted_data_pdu, { "snmp.failed_decrypted_data_pdu", PI_MALFORMED, PI_WARN, "Failed to decrypt encryptedPDU", EXPFILL }},
diff --git a/epan/dissectors/packet-turbocell.c b/epan/dissectors/packet-turbocell.c
index b6dccf850c..713e39edc4 100644
--- a/epan/dissectors/packet-turbocell.c
+++ b/epan/dissectors/packet-turbocell.c
@@ -166,7 +166,7 @@ dissect_turbocell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
network_tree = proto_item_add_subtree(name_item, ett_network);
str_name=tvb_get_stringz_enc(wmem_packet_scope(), tvb, 0x14, &str_len, ENC_ASCII);
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Network=\"%s\"",format_text(str_name, str_len-1));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Network=\"%s\"", format_text_wmem(wmem_packet_scope(), str_name, str_len-1));
while(tvb_get_guint8(tvb, 0x34 + 8*i)==0x00 && (tvb_reported_length_remaining(tvb,0x34 + 8*i) > 6) && (i<32)) {
proto_tree_add_item(network_tree, hf_turbocell_station, tvb, 0x34+8*i, 6, ENC_NA);
diff --git a/epan/dissectors/packet-wbxml.c b/epan/dissectors/packet-wbxml.c
index 8693764caa..131994d766 100644
--- a/epan/dissectors/packet-wbxml.c
+++ b/epan/dissectors/packet-wbxml.c
@@ -6977,7 +6977,7 @@ show_wbxml_string_table (proto_tree *tree, tvbuff_t *tvb, guint32 str_tbl,
proto_tree_add_item_ret_string_and_length (item_tree,
hf_wbxml_string_table_item_string,
tvb, off, -1, encoding, wmem_packet_scope(), &str, &len);
- proto_item_append_text(ti, " '%s'", format_text(str, strlen(str)));
+ proto_item_append_text(ti, " '%s'", format_text_wmem(wmem_packet_scope(), str, strlen(str)));
proto_item_set_len(ti, len);
off += len;
}
diff --git a/epan/strutil.c b/epan/strutil.c
index c4a65849a4..d4cab96cb6 100644
--- a/epan/strutil.c
+++ b/epan/strutil.c
@@ -245,6 +245,101 @@ format_text(const guchar *string, size_t len)
/*
* Given a string, generate a string from it that shows non-printable
+ * characters as C-style escapes, and return a pointer to it.
+ */
+gchar *
+format_text_wmem(wmem_allocator_t* allocator, const guchar *string, size_t len)
+{
+ gchar *fmtbuf = (gchar*)wmem_alloc(allocator, INITIAL_FMTBUF_SIZE);
+ int fmtbuf_len = INITIAL_FMTBUF_SIZE;
+ int column;
+ const guchar *stringend = string + len;
+ guchar c;
+ int i;
+
+ column = 0;
+ while (string < stringend) {
+ /*
+ * Is there enough room for this character, if it expands to
+ * a backslash plus 3 octal digits (which is the most it can
+ * expand to), and also enough room for a terminating '\0'?
+ */
+ if (column+3+1 >= fmtbuf_len) {
+ /*
+ * Double the buffer's size if it's not big enough.
+ * The size of the buffer starts at 128, so doubling its size
+ * adds at least another 128 bytes, which is more than enough
+ * for one more character plus a terminating '\0'.
+ */
+ fmtbuf_len *= 2;
+ fmtbuf = (gchar *)wmem_realloc(allocator, fmtbuf, fmtbuf_len);
+ }
+ c = *string++;
+
+ if (g_ascii_isprint(c)) {
+ fmtbuf[column] = c;
+ column++;
+ } else {
+ fmtbuf[column] = '\\';
+ column++;
+ switch (c) {
+
+ case '\a':
+ fmtbuf[column] = 'a';
+ column++;
+ break;
+
+ case '\b':
+ fmtbuf[column] = 'b'; /* BS */
+ column++;
+ break;
+
+ case '\f':
+ fmtbuf[column] = 'f'; /* FF */
+ column++;
+ break;
+
+ case '\n':
+ fmtbuf[column] = 'n'; /* NL */
+ column++;
+ break;
+
+ case '\r':
+ fmtbuf[column] = 'r'; /* CR */
+ column++;
+ break;
+
+ case '\t':
+ fmtbuf[column] = 't'; /* tab */
+ column++;
+ break;
+
+ case '\v':
+ fmtbuf[column] = 'v';
+ column++;
+ break;
+
+ default:
+ i = (c>>6)&03;
+ fmtbuf[column] = i + '0';
+ column++;
+ i = (c>>3)&07;
+ fmtbuf[column] = i + '0';
+ column++;
+ i = (c>>0)&07;
+ fmtbuf[column] = i + '0';
+ column++;
+ break;
+ }
+ }
+ }
+ fmtbuf[column] = '\0';
+ return fmtbuf;
+}
+
+
+/*
+ * Given a string, generate a string from it that shows non-printable
* characters as C-style escapes except a whitespace character
* (space, tab, carriage return, new line, vertical tab, or formfeed)
* which will be replaced by a space, and return a pointer to it.
diff --git a/epan/strutil.h b/epan/strutil.h
index 8cba9112fb..973bc8a06e 100644
--- a/epan/strutil.h
+++ b/epan/strutil.h
@@ -70,6 +70,19 @@ int get_token_len(const guchar *linep, const guchar *lineend,
WS_DLL_PUBLIC
gchar* format_text(const guchar *line, size_t len);
+/** Given a string, generate a string from it that shows non-printable
+ * characters as C-style escapes, and return a pointer to it.
+ *
+ * @param allocator The wmem scope
+ * @param line A pointer to the input string
+ * @param len The length of the input string
+ * @return A pointer to the formatted string
+ *
+ * @see tvb_format_text()
+ */
+WS_DLL_PUBLIC
+gchar* format_text_wmem(wmem_allocator_t* allocator, const guchar *line, size_t len);
+
/**
* Given a string, generate a string from it that shows non-printable
* characters as C-style escapes except a whitespace character