aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2013-09-22 15:50:55 +0000
committerPascal Quantin <pascal.quantin@gmail.com>2013-09-22 15:50:55 +0000
commita0c53ffaa1bb46d8c9db2ec739401aa411c9790e (patch)
tree56a11c9e0910032ad43476462dd2c95ed65e5cc1
parentc4a608a94071f4a23eaf16fd3ab9545e26309f76 (diff)
emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits() - tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup() - tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode() - tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string() - tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string() - tvb_get_ephemeral_string_enc() -> tvb_get_string_enc() - update docs accordingly svn path=/trunk/; revision=52172
-rw-r--r--asn1/ansi_map/packet-ansi_map-template.c4
-rw-r--r--asn1/c1222/packet-c1222-template.c12
-rw-r--r--asn1/ess/packet-ess-template.c2
-rw-r--r--asn1/gprscdr/gprscdr.cnf18
-rw-r--r--asn1/gsm_map/gsm_map.cnf4
-rw-r--r--asn1/h248/h248.cnf2
-rw-r--r--asn1/ldap/ldap.cnf8
-rw-r--r--asn1/ldap/packet-ldap-template.c2
-rw-r--r--asn1/lte-rrc/lte-rrc.cnf2
-rw-r--r--asn1/lte-rrc/packet-lte-rrc-template.c2
-rw-r--r--asn1/pkcs12/packet-pkcs12-template.c4
-rw-r--r--asn1/ranap/ranap.cnf2
-rw-r--r--asn1/rrc/rrc.cnf2
-rw-r--r--asn1/sabp/packet-sabp-template.c2
-rw-r--r--asn1/snmp/packet-snmp-template.c22
-rw-r--r--asn1/t124/t124.cnf2
-rw-r--r--asn1/x509sat/x509sat.cnf2
-rw-r--r--doc/README.developer4
-rw-r--r--doc/README.dissector44
-rw-r--r--epan/dissectors/file-mp4.c2
-rw-r--r--epan/dissectors/packet-9p.c12
-rw-r--r--epan/dissectors/packet-aastra-aasp.c10
-rw-r--r--epan/dissectors/packet-adwin-config.c10
-rw-r--r--epan/dissectors/packet-afp.c18
-rw-r--r--epan/dissectors/packet-aim-messaging.c2
-rw-r--r--epan/dissectors/packet-aim.c6
-rw-r--r--epan/dissectors/packet-alcap.c4
-rw-r--r--epan/dissectors/packet-amqp.c10
-rw-r--r--epan/dissectors/packet-ansi_a.c18
-rw-r--r--epan/dissectors/packet-ansi_map.c4
-rw-r--r--epan/dissectors/packet-applemidi.c2
-rw-r--r--epan/dissectors/packet-aprs.c4
-rw-r--r--epan/dissectors/packet-ar_drone.c8
-rw-r--r--epan/dissectors/packet-artnet.c2
-rw-r--r--epan/dissectors/packet-asap.c2
-rw-r--r--epan/dissectors/packet-assa_r3.c20
-rw-r--r--epan/dissectors/packet-atalk.c6
-rw-r--r--epan/dissectors/packet-bacapp.c2
-rw-r--r--epan/dissectors/packet-ber.c8
-rw-r--r--epan/dissectors/packet-bfd.c2
-rw-r--r--epan/dissectors/packet-bittorrent.c8
-rw-r--r--epan/dissectors/packet-bmc.c2
-rw-r--r--epan/dissectors/packet-bootp.c2
-rw-r--r--epan/dissectors/packet-bt-dht.c6
-rw-r--r--epan/dissectors/packet-btavrcp.c10
-rw-r--r--epan/dissectors/packet-bthci_evt.c6
-rw-r--r--epan/dissectors/packet-bthcrp.c2
-rw-r--r--epan/dissectors/packet-bthfp.c2
-rw-r--r--epan/dissectors/packet-btobex.c4
-rw-r--r--epan/dissectors/packet-btsdp.c62
-rw-r--r--epan/dissectors/packet-c1222.c12
-rw-r--r--epan/dissectors/packet-catapult-dct2000.c6
-rw-r--r--epan/dissectors/packet-cell_broadcast.c10
-rw-r--r--epan/dissectors/packet-cip.c2
-rw-r--r--epan/dissectors/packet-cmpp.c2
-rw-r--r--epan/dissectors/packet-coap.c12
-rw-r--r--epan/dissectors/packet-collectd.c8
-rw-r--r--epan/dissectors/packet-cops.c6
-rw-r--r--epan/dissectors/packet-data.c2
-rw-r--r--epan/dissectors/packet-dbus.c6
-rw-r--r--epan/dissectors/packet-dcerpc-epm.c8
-rw-r--r--epan/dissectors/packet-dcerpc-eventlog.c6
-rw-r--r--epan/dissectors/packet-dcerpc-fileexp.c6
-rw-r--r--epan/dissectors/packet-dcerpc-fldb.c16
-rw-r--r--epan/dissectors/packet-dcerpc-netlogon.c2
-rw-r--r--epan/dissectors/packet-dcerpc-nt.c12
-rw-r--r--epan/dissectors/packet-dcerpc-rpriv.c4
-rw-r--r--epan/dissectors/packet-dcerpc-rs_acct.c4
-rw-r--r--epan/dissectors/packet-dcerpc-rs_misc.c2
-rw-r--r--epan/dissectors/packet-dcerpc-rs_pgo.c4
-rw-r--r--epan/dissectors/packet-dcerpc-spoolss.c6
-rw-r--r--epan/dissectors/packet-dcerpc.c16
-rw-r--r--epan/dissectors/packet-dcm.c10
-rw-r--r--epan/dissectors/packet-dcp-etsi.c6
-rw-r--r--epan/dissectors/packet-dec-dnart.c10
-rw-r--r--epan/dissectors/packet-dhcp-failover.c4
-rw-r--r--epan/dissectors/packet-dhcpv6.c4
-rw-r--r--epan/dissectors/packet-dmp.c6
-rw-r--r--epan/dissectors/packet-dnp.c2
-rw-r--r--epan/dissectors/packet-dns.c10
-rw-r--r--epan/dissectors/packet-dsi.c4
-rw-r--r--epan/dissectors/packet-dtn.c2
-rw-r--r--epan/dissectors/packet-dtpt.c2
-rw-r--r--epan/dissectors/packet-dua.c4
-rw-r--r--epan/dissectors/packet-dvbci.c16
-rw-r--r--epan/dissectors/packet-edonkey.c8
-rw-r--r--epan/dissectors/packet-eigrp.c2
-rw-r--r--epan/dissectors/packet-elcom.c4
-rw-r--r--epan/dissectors/packet-enrp.c2
-rw-r--r--epan/dissectors/packet-epmd.c8
-rw-r--r--epan/dissectors/packet-erldp.c6
-rw-r--r--epan/dissectors/packet-ess.c2
-rw-r--r--epan/dissectors/packet-etsi_card_app_toolkit.c6
-rw-r--r--epan/dissectors/packet-exported_pdu.c2
-rw-r--r--epan/dissectors/packet-extreme.c4
-rw-r--r--epan/dissectors/packet-fc.c4
-rw-r--r--epan/dissectors/packet-fcdns.c4
-rw-r--r--epan/dissectors/packet-fcgi.c4
-rw-r--r--epan/dissectors/packet-fcswils.c2
-rw-r--r--epan/dissectors/packet-fix.c10
-rw-r--r--epan/dissectors/packet-fmtp.c6
-rw-r--r--epan/dissectors/packet-foundry.c2
-rw-r--r--epan/dissectors/packet-gadu-gadu.c8
-rw-r--r--epan/dissectors/packet-gearman.c8
-rw-r--r--epan/dissectors/packet-git.c2
-rw-r--r--epan/dissectors/packet-glusterfs.c2
-rw-r--r--epan/dissectors/packet-gopher.c4
-rw-r--r--epan/dissectors/packet-gprscdr.c18
-rw-r--r--epan/dissectors/packet-gsm_a_common.c2
-rw-r--r--epan/dissectors/packet-gsm_a_dtap.c8
-rw-r--r--epan/dissectors/packet-gsm_map.c4
-rw-r--r--epan/dissectors/packet-gsm_sms.c4
-rw-r--r--epan/dissectors/packet-gtp.c6
-rw-r--r--epan/dissectors/packet-gtpv2.c8
-rw-r--r--epan/dissectors/packet-h248.c2
-rw-r--r--epan/dissectors/packet-hip.c4
-rw-r--r--epan/dissectors/packet-hpfeeds.c4
-rw-r--r--epan/dissectors/packet-http.c6
-rw-r--r--epan/dissectors/packet-iax2.c2
-rw-r--r--epan/dissectors/packet-icep.c2
-rw-r--r--epan/dissectors/packet-icp.c6
-rw-r--r--epan/dissectors/packet-icq.c26
-rw-r--r--epan/dissectors/packet-ieee80211-prism.c2
-rw-r--r--epan/dissectors/packet-ieee80211-radiotap.c2
-rw-r--r--epan/dissectors/packet-ieee80211.c14
-rw-r--r--epan/dissectors/packet-ieee802154.c4
-rw-r--r--epan/dissectors/packet-image-gif.c2
-rw-r--r--epan/dissectors/packet-imf.c14
-rw-r--r--epan/dissectors/packet-ipp.c2
-rw-r--r--epan/dissectors/packet-irc.c8
-rw-r--r--epan/dissectors/packet-isakmp.c32
-rw-r--r--epan/dissectors/packet-iscsi.c2
-rw-r--r--epan/dissectors/packet-isis-clv.c4
-rw-r--r--epan/dissectors/packet-ismp.c2
-rw-r--r--epan/dissectors/packet-isup.c2
-rw-r--r--epan/dissectors/packet-iua.c4
-rw-r--r--epan/dissectors/packet-iuup.c2
-rw-r--r--epan/dissectors/packet-json.c2
-rw-r--r--epan/dissectors/packet-jxta.c8
-rw-r--r--epan/dissectors/packet-kerberos.c2
-rw-r--r--epan/dissectors/packet-kismet.c2
-rw-r--r--epan/dissectors/packet-lapsat.c2
-rw-r--r--epan/dissectors/packet-ldap.c10
-rw-r--r--epan/dissectors/packet-ldss.c4
-rw-r--r--epan/dissectors/packet-lte-rrc.c4
-rw-r--r--epan/dissectors/packet-lwres.c4
-rw-r--r--epan/dissectors/packet-m2tp.c2
-rw-r--r--epan/dissectors/packet-m2ua.c4
-rw-r--r--epan/dissectors/packet-m3ua.c2
-rw-r--r--epan/dissectors/packet-memcache.c2
-rw-r--r--epan/dissectors/packet-mgcp.c6
-rw-r--r--epan/dissectors/packet-mih.c8
-rw-r--r--epan/dissectors/packet-mikey.c4
-rw-r--r--epan/dissectors/packet-mmse.c8
-rw-r--r--epan/dissectors/packet-mq-pcf.c6
-rw-r--r--epan/dissectors/packet-mq.c26
-rw-r--r--epan/dissectors/packet-mrcpv2.c28
-rw-r--r--epan/dissectors/packet-ms-mms.c10
-rw-r--r--epan/dissectors/packet-msproxy.c14
-rw-r--r--epan/dissectors/packet-msrp.c8
-rw-r--r--epan/dissectors/packet-multipart.c4
-rw-r--r--epan/dissectors/packet-mux27010.c2
-rw-r--r--epan/dissectors/packet-mysql.c8
-rw-r--r--epan/dissectors/packet-nasdaq-itch.c10
-rw-r--r--epan/dissectors/packet-ndps.c4
-rw-r--r--epan/dissectors/packet-nfs.c12
-rw-r--r--epan/dissectors/packet-nlm.c2
-rw-r--r--epan/dissectors/packet-ntlmssp.c6
-rw-r--r--epan/dissectors/packet-ntp.c2
-rw-r--r--epan/dissectors/packet-opensafety.c6
-rw-r--r--epan/dissectors/packet-opsi.c2
-rw-r--r--epan/dissectors/packet-p_mul.c2
-rw-r--r--epan/dissectors/packet-pagp.c4
-rw-r--r--epan/dissectors/packet-per.c2
-rw-r--r--epan/dissectors/packet-pflog.c4
-rw-r--r--epan/dissectors/packet-pkcs12.c4
-rw-r--r--epan/dissectors/packet-pnrp.c2
-rw-r--r--epan/dissectors/packet-ppcap.c4
-rw-r--r--epan/dissectors/packet-ppp.c2
-rw-r--r--epan/dissectors/packet-pppoe.c2
-rw-r--r--epan/dissectors/packet-ptpip.c2
-rw-r--r--epan/dissectors/packet-pvfs2.c4
-rw-r--r--epan/dissectors/packet-q2931.c6
-rw-r--r--epan/dissectors/packet-q931.c8
-rw-r--r--epan/dissectors/packet-q933.c2
-rw-r--r--epan/dissectors/packet-quake2.c6
-rw-r--r--epan/dissectors/packet-ranap.c2
-rw-r--r--epan/dissectors/packet-rdp.c4
-rw-r--r--epan/dissectors/packet-reload.c2
-rw-r--r--epan/dissectors/packet-rpc.c2
-rw-r--r--epan/dissectors/packet-rpcap.c6
-rw-r--r--epan/dissectors/packet-rrc.c2
-rw-r--r--epan/dissectors/packet-rsvp.c4
-rw-r--r--epan/dissectors/packet-rtcp.c6
-rw-r--r--epan/dissectors/packet-rtmpt.c26
-rw-r--r--epan/dissectors/packet-rtpproxy.c2
-rw-r--r--epan/dissectors/packet-rtps.c22
-rw-r--r--epan/dissectors/packet-rtsp.c4
-rw-r--r--epan/dissectors/packet-sabp.c2
-rw-r--r--epan/dissectors/packet-sametime.c2
-rw-r--r--epan/dissectors/packet-sap.c2
-rw-r--r--epan/dissectors/packet-sbus.c18
-rw-r--r--epan/dissectors/packet-sctp.c2
-rw-r--r--epan/dissectors/packet-sdp.c72
-rw-r--r--epan/dissectors/packet-selfm.c10
-rw-r--r--epan/dissectors/packet-sgsap.c8
-rw-r--r--epan/dissectors/packet-sip.c32
-rw-r--r--epan/dissectors/packet-sipfrag.c2
-rw-r--r--epan/dissectors/packet-slsk.c6
-rw-r--r--epan/dissectors/packet-smb-pipe.c4
-rw-r--r--epan/dissectors/packet-smb.c6
-rw-r--r--epan/dissectors/packet-smb2.c2
-rw-r--r--epan/dissectors/packet-smtp.c50
-rw-r--r--epan/dissectors/packet-sna.c2
-rw-r--r--epan/dissectors/packet-snmp.c22
-rw-r--r--epan/dissectors/packet-socks.c6
-rw-r--r--epan/dissectors/packet-soupbintcp.c6
-rw-r--r--epan/dissectors/packet-srvloc.c16
-rw-r--r--epan/dissectors/packet-ssh.c2
-rw-r--r--epan/dissectors/packet-stun.c16
-rw-r--r--epan/dissectors/packet-sua.c4
-rw-r--r--epan/dissectors/packet-synphasor.c4
-rw-r--r--epan/dissectors/packet-sysex.c4
-rw-r--r--epan/dissectors/packet-t124.c2
-rw-r--r--epan/dissectors/packet-tacacs.c2
-rw-r--r--epan/dissectors/packet-tcp.c2
-rw-r--r--epan/dissectors/packet-tds.c48
-rw-r--r--epan/dissectors/packet-telnet.c2
-rw-r--r--epan/dissectors/packet-tftp.c4
-rw-r--r--epan/dissectors/packet-tivoconnect.c2
-rw-r--r--epan/dissectors/packet-tnef.c6
-rw-r--r--epan/dissectors/packet-ucp.c4
-rw-r--r--epan/dissectors/packet-uma.c4
-rw-r--r--epan/dissectors/packet-umts_fp.c10
-rw-r--r--epan/dissectors/packet-usb.c4
-rw-r--r--epan/dissectors/packet-uts.c2
-rw-r--r--epan/dissectors/packet-v5ua.c8
-rw-r--r--epan/dissectors/packet-vnc.c12
-rw-r--r--epan/dissectors/packet-vtp.c2
-rw-r--r--epan/dissectors/packet-wol.c2
-rw-r--r--epan/dissectors/packet-wow.c8
-rw-r--r--epan/dissectors/packet-wps.c2
-rw-r--r--epan/dissectors/packet-wsp.c6
-rw-r--r--epan/dissectors/packet-x11.c6
-rw-r--r--epan/dissectors/packet-x509sat.c2
-rw-r--r--epan/dissectors/packet-xcsl.c2
-rw-r--r--epan/dissectors/packet-xdmcp.c2
-rw-r--r--epan/dissectors/packet-xmcp.c20
-rw-r--r--epan/dissectors/packet-xml.c14
-rw-r--r--epan/dissectors/packet-xmpp-utils.c6
-rw-r--r--epan/dissectors/packet-xtp.c2
-rw-r--r--epan/dissectors/packet-yami.c6
-rw-r--r--epan/dissectors/packet-zbee-security.c8
-rw-r--r--epan/dissectors/packet-zbee-zcl-se.c2
-rw-r--r--epan/dissectors/packet-zbee-zcl.c4
-rw-r--r--epan/dissectors/packet-zbee-zdp-discovery.c2
-rw-r--r--epan/dissectors/packet-zep.c2
-rw-r--r--epan/dissectors/pidl/eventlog.cnf6
-rw-r--r--epan/proto.c11
-rw-r--r--epan/req_resp_hdrs.c6
-rw-r--r--epan/tpg.h8
-rw-r--r--epan/tvbparse.c2
-rw-r--r--epan/tvbtest.c6
-rw-r--r--epan/tvbuff.c225
-rw-r--r--epan/tvbuff.h68
-rw-r--r--epan/tvbuff_composite.c2
-rw-r--r--epan/wslua/wslua_dumper.c2
-rw-r--r--epan/wslua/wslua_field.c10
-rw-r--r--epan/wslua/wslua_tvb.c8
-rw-r--r--plugins/irda/packet-irda.c2
-rw-r--r--plugins/unistim/packet-unistim.c2
-rw-r--r--plugins/wimaxasncp/packet-wimaxasncp.c2
272 files changed, 992 insertions, 1164 deletions
diff --git a/asn1/ansi_map/packet-ansi_map-template.c b/asn1/ansi_map/packet-ansi_map-template.c
index a26409b6af..607f489161 100644
--- a/asn1/ansi_map/packet-ansi_map-template.c
+++ b/asn1/ansi_map/packet-ansi_map-template.c
@@ -705,7 +705,7 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
return;
offset++;
proto_tree_add_item(subtree, hf_ansi_map_ia5_digits, tvb, offset, -1, ENC_ASCII|ENC_NA);
- proto_item_append_text(actx->created_item, " - %s", tvb_get_ephemeral_string(tvb,offset,tvb_length_remaining(tvb,offset)));
+ proto_item_append_text(actx->created_item, " - %s", tvb_get_string(wmem_packet_scope(),tvb,offset,tvb_length_remaining(tvb,offset)));
break;
case 3:
/* Octet string */
@@ -738,7 +738,7 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
case 2:
/* IA5 Coding */
proto_tree_add_item(subtree, hf_ansi_map_ia5_digits, tvb, offset, -1, ENC_ASCII|ENC_NA);
- proto_item_append_text(actx->created_item, " - %s", tvb_get_ephemeral_string(tvb,offset,tvb_length_remaining(tvb,offset)));
+ proto_item_append_text(actx->created_item, " - %s", tvb_get_string(wmem_packet_scope(),tvb,offset,tvb_length_remaining(tvb,offset)));
break;
case 3:
/* Octet string */
diff --git a/asn1/c1222/packet-c1222-template.c b/asn1/c1222/packet-c1222-template.c
index 4e5113cc97..594c50d7e5 100644
--- a/asn1/c1222/packet-c1222-template.c
+++ b/asn1/c1222/packet-c1222-template.c
@@ -301,11 +301,11 @@ static uat_t *c1222_uat;
#define FILL_START int length, start_offset = offset;
#define FILL_TABLE(fieldname) \
length = offset - start_offset; \
- fieldname = (guint8 *)tvb_g_memdup(tvb, start_offset, length); \
+ fieldname = (guint8 *)tvb_memdup(NULL, tvb, start_offset, length); \
fieldname##_len = length;
#define FILL_TABLE_TRUNCATE(fieldname, len) \
length = 1 + 2*(offset - start_offset); \
- fieldname = (guint8 *)tvb_g_memdup(tvb, start_offset, length); \
+ fieldname = (guint8 *)tvb_memdup(NULL, tvb, start_offset, length); \
fieldname##_len = len;
#else /* HAVE_LIBGCRYPT */
#define FILL_TABLE(fieldname)
@@ -388,7 +388,7 @@ parse_c1222_detailed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int cm
user_id = tvb_get_ntohs(tvb, *offset);
proto_tree_add_uint(tree, hf_c1222_logon_id, tvb, *offset, 2, user_id);
*offset += 2;
- user_name = tvb_get_ephemeral_string(tvb, *offset, 10);
+ user_name = tvb_get_string(wmem_packet_scope(),tvb, *offset, 10);
proto_tree_add_string(tree, hf_c1222_logon_user, tvb, *offset, 10, user_name);
*offset += 10;
*length -= 12;
@@ -400,7 +400,7 @@ parse_c1222_detailed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int cm
break;
case C1222_CMD_SECURITY:
if (*length >= 20) {
- password = tvb_get_ephemeral_string(tvb, *offset, 20);
+ password = tvb_get_string(wmem_packet_scope(),tvb, *offset, 20);
proto_tree_add_string(tree, hf_c1222_security_password, tvb, *offset, 20, password);
*offset += 20;
*length -= 20;
@@ -919,7 +919,7 @@ dissect_epsem(tvbuff_t *tvb, int offset, guint32 len, packet_info *pinfo, proto_
return offset;
encrypted = TRUE;
if (c1222_decrypt) {
- buffer = (guchar *)tvb_g_memdup(tvb, offset, len2);
+ buffer = (guchar *)tvb_memdup(NULL, tvb, offset, len2);
if (!decrypt_packet(buffer, len2, TRUE)) {
g_free(buffer);
crypto_bad = TRUE;
@@ -938,7 +938,7 @@ dissect_epsem(tvbuff_t *tvb, int offset, guint32 len, packet_info *pinfo, proto_
len2 = tvb_length_remaining(tvb, offset);
if (len2 <= 0)
return offset;
- buffer = (guchar *)tvb_g_memdup(tvb, offset, len2);
+ buffer = (guchar *)tvb_memdup(NULL, tvb, offset, len2);
epsem_buffer = tvb_new_subset_remaining(tvb, offset);
if (c1222_decrypt) {
if (!decrypt_packet(buffer, len2, FALSE)) {
diff --git a/asn1/ess/packet-ess-template.c b/asn1/ess/packet-ess-template.c
index b173dd4cb9..a78078d15e 100644
--- a/asn1/ess/packet-ess-template.c
+++ b/asn1/ess/packet-ess-template.c
@@ -120,7 +120,7 @@ ess_dissect_attribute_flags (tvbuff_t *tvb, asn1_ctx_t *actx)
guint i;
tree = proto_item_add_subtree (actx->created_item, ett_Category_attributes);
- value = tvb_get_ephemeral_string (tvb, 0, tvb_length (tvb));
+ value = tvb_get_string (wmem_packet_scope(), tvb, 0, tvb_length (tvb));
for (i = 0; i < num_ess_category_attributes; i++) {
ess_category_attributes_t *u = &(ess_category_attributes[i]);
diff --git a/asn1/gprscdr/gprscdr.cnf b/asn1/gprscdr/gprscdr.cnf
index d1d1ca88dc..317ec67584 100644
--- a/asn1/gprscdr/gprscdr.cnf
+++ b/asn1/gprscdr/gprscdr.cnf
@@ -77,15 +77,15 @@ GPRSRecord
return offset;
proto_item_append_text(actx->created_item, " (UTC %%x-%%x-%%x %%x:%%x:%%x %%s%%x:%%x)",
- tvb_get_guint8(parameter_tvb,0), /* Year */
- tvb_get_guint8(parameter_tvb,1), /* Month */
- tvb_get_guint8(parameter_tvb,2), /* Day */
- tvb_get_guint8(parameter_tvb,3), /* Hour */
- tvb_get_guint8(parameter_tvb,4), /* Minute */
- tvb_get_guint8(parameter_tvb,5), /* Second */
- tvb_get_ephemeral_string(parameter_tvb,6,1), /* Sign */
- tvb_get_guint8(parameter_tvb,7), /* Hour */
- tvb_get_guint8(parameter_tvb,8) /* Minute */
+ tvb_get_guint8(parameter_tvb,0), /* Year */
+ tvb_get_guint8(parameter_tvb,1), /* Month */
+ tvb_get_guint8(parameter_tvb,2), /* Day */
+ tvb_get_guint8(parameter_tvb,3), /* Hour */
+ tvb_get_guint8(parameter_tvb,4), /* Minute */
+ tvb_get_guint8(parameter_tvb,5), /* Second */
+ tvb_get_string(wmem_packet_scope(), parameter_tvb,6,1), /* Sign */
+ tvb_get_guint8(parameter_tvb,7), /* Hour */
+ tvb_get_guint8(parameter_tvb,8) /* Minute */
);
#.FN_BODY MSTimeZone VAL_PTR = &parameter_tvb
diff --git a/asn1/gsm_map/gsm_map.cnf b/asn1/gsm_map/gsm_map.cnf
index 3b9989e1f7..9e03da1e72 100644
--- a/asn1/gsm_map/gsm_map.cnf
+++ b/asn1/gsm_map/gsm_map.cnf
@@ -499,7 +499,7 @@ actx->pinfo->p2p_dir = P2P_DIR_RECV;
proto_tree_add_text(tree, parameter_tvb, 0, length, "USSD String: %%s", utf8_text);
break;
case SMS_ENCODING_8BIT:
- proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %%s", tvb_get_ephemeral_string(parameter_tvb, 0, length));
+ proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %%s", tvb_get_string(wmem_packet_scope(), parameter_tvb, 0, length));
break;
case SMS_ENCODING_UCS2:
case SMS_ENCODING_UCS2_LANG:
@@ -880,7 +880,7 @@ if (!actx->value_ptr)
length = tvb_length(parameter_tvb);
name_len = tvb_get_guint8(parameter_tvb, 0);
- apn_str = tvb_get_ephemeral_string(parameter_tvb, 1, length - 1);
+ apn_str = tvb_get_string(wmem_packet_scope(), parameter_tvb, 1, length - 1);
if (name_len < length-1) {
for (;;) {
if (name_len >= length - 1)
diff --git a/asn1/h248/h248.cnf b/asn1/h248/h248.cnf
index 23caf2c981..6d17c50739 100644
--- a/asn1/h248/h248.cnf
+++ b/asn1/h248/h248.cnf
@@ -339,7 +339,7 @@ AuditReplyV1/auditResult audit_result
curr_info.term->type = 0; /* unknown */
if (curr_info.term->len) {
- curr_info.term->buffer = (guint8 *)ep_tvb_memdup(new_tvb,0,curr_info.term->len);
+ curr_info.term->buffer = (guint8 *)tvb_memdup(wmem_packet_scope(),new_tvb,0,curr_info.term->len);
curr_info.term->str = bytes_to_str(curr_info.term->buffer,curr_info.term->len);
}
diff --git a/asn1/ldap/ldap.cnf b/asn1/ldap/ldap.cnf
index 43e36dc115..ed9ab2d469 100644
--- a/asn1/ldap/ldap.cnf
+++ b/asn1/ldap/ldap.cnf
@@ -64,7 +64,7 @@ PasswordPolicyResponseValue B "1.3.6.1.4.1.42.2.27.8.5.1" "passwordPolicy"
if (!parameter_tvb)
return offset;
- object_identifier_id = tvb_get_ephemeral_string(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0));
+ object_identifier_id = tvb_get_string(wmem_packet_scope(), parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0));
name = oid_resolved_from_string(object_identifier_id);
if(name){
@@ -194,7 +194,7 @@ char *mechanism = NULL;
* different type and/or mechanism.
*/
if(!actx->pinfo->fd->flags.visited) {
- mechanism = tvb_get_g_string(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0));
+ mechanism = tvb_get_string(NULL, parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0));
ldap_info->first_auth_frame = 0; /* not known until we see the bind reply */
/*
* If the mechanism in this request is an empty string (which is
@@ -330,7 +330,7 @@ ldap_conv_info_t *ldap_info;
ldap_do_protocolop(actx->pinfo);
if(parameter_tvb)
- ldapstring = tvb_get_ephemeral_string(parameter_tvb, 0, tvb_length_remaining(parameter_tvb, 0));
+ ldapstring = tvb_get_string(wmem_packet_scope(), parameter_tvb, 0, tvb_length_remaining(parameter_tvb, 0));
if(hf_index == hf_ldap_baseObject) {
/* this is search - put it on the scanline */
@@ -485,7 +485,7 @@ ldap_conv_info_t *ldap_info;
break;
if(i == len) {
- string = tvb_get_ephemeral_string(next_tvb, 0, tvb_length_remaining(next_tvb, 0));
+ string = tvb_get_string(wmem_packet_scope(), next_tvb, 0, tvb_length_remaining(next_tvb, 0));
proto_item_set_text(actx->created_item, "AttributeValue: %%s", string);
}
}
diff --git a/asn1/ldap/packet-ldap-template.c b/asn1/ldap/packet-ldap-template.c
index 47a93bc43d..ab5a6b78a2 100644
--- a/asn1/ldap/packet-ldap-template.c
+++ b/asn1/ldap/packet-ldap-template.c
@@ -1666,7 +1666,7 @@ dissect_ldap_oid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
* proto_tree_add_oid() instead.
*/
- oid=tvb_get_ephemeral_string(tvb, 0, tvb_length(tvb));
+ oid=tvb_get_string(wmem_packet_scope(), tvb, 0, tvb_length(tvb));
if(!oid){
return;
}
diff --git a/asn1/lte-rrc/lte-rrc.cnf b/asn1/lte-rrc/lte-rrc.cnf
index be7c903286..03fd1ce8c8 100644
--- a/asn1/lte-rrc/lte-rrc.cnf
+++ b/asn1/lte-rrc/lte-rrc.cnf
@@ -489,7 +489,7 @@ SystemInformationBlockType9/hnb-Name TYPE=FT_STRING DISPLAY=BASE_NONE
%(DEFAULT_BODY)s
actx->created_item = proto_tree_add_unicode_string(tree, hf_index, hnb_name_tvb, 0, -1,
- tvb_get_ephemeral_string_enc(hnb_name_tvb, 0, tvb_length(hnb_name_tvb), ENC_UTF_8 | ENC_NA));
+ tvb_get_string_enc(wmem_packet_scope(), hnb_name_tvb, 0, tvb_length(hnb_name_tvb), ENC_UTF_8 | ENC_NA));
#.TYPE_ATTR
SystemInformationBlockType10/messageIdentifier TYPE=FT_UINT16 DISPLAY=BASE_DEC|BASE_EXT_STRING STRINGS=&lte_rrc_messageIdentifier_vals_ext
diff --git a/asn1/lte-rrc/packet-lte-rrc-template.c b/asn1/lte-rrc/packet-lte-rrc-template.c
index 127cc35a6d..5154b081b8 100644
--- a/asn1/lte-rrc/packet-lte-rrc-template.c
+++ b/asn1/lte-rrc/packet-lte-rrc-template.c
@@ -1938,7 +1938,7 @@ dissect_lte_rrc_warningMessageSegment(tvbuff_t *warning_msg_seg_tvb, proto_tree
cb_data_page_tvb = tvb_new_subset(warning_msg_seg_tvb, offset, length, length);
cb_data_tvb = dissect_cbs_data(dataCodingScheme, cb_data_page_tvb, tree, pinfo, 0);
if (cb_data_tvb) {
- str = tvb_get_ephemeral_string(cb_data_tvb, 0, tvb_length(cb_data_tvb));
+ str = tvb_get_string(wmem_packet_scope(), cb_data_tvb, 0, tvb_length(cb_data_tvb));
proto_tree_add_string_format(tree, hf_lte_rrc_warningMessageSegment_decoded_page, warning_msg_seg_tvb, offset, 83,
str, "Decoded Page %u: %s", i+1, str);
}
diff --git a/asn1/pkcs12/packet-pkcs12-template.c b/asn1/pkcs12/packet-pkcs12-template.c
index e8d0a7cbef..d0e2e64e33 100644
--- a/asn1/pkcs12/packet-pkcs12-template.c
+++ b/asn1/pkcs12/packet-pkcs12-template.c
@@ -111,7 +111,7 @@ generate_key_or_iv(unsigned int id, tvbuff_t *salt_tvb, unsigned int iter,
cur_keylen = 0;
salt_size = tvb_length(salt_tvb);
- salt_p = tvb_get_ephemeral_string(salt_tvb, 0, salt_size);
+ salt_p = tvb_get_string(wmem_packet_scope(), salt_tvb, 0, salt_size);
if (pw == NULL)
pwlen = 0;
@@ -307,7 +307,7 @@ int PBE_decrypt_data(const char *object_identifier_id_param, tvbuff_t *encrypted
datalen = tvb_length(encrypted_tvb);
clear_data = (char *)g_malloc(datalen);
- err = gcry_cipher_decrypt (cipher, clear_data, datalen, tvb_get_ephemeral_string(encrypted_tvb, 0, datalen), datalen);
+ err = gcry_cipher_decrypt (cipher, clear_data, datalen, tvb_get_string(wmem_packet_scope(), encrypted_tvb, 0, datalen), datalen);
if (gcry_err_code (err)) {
proto_item_append_text(item, " [Failed to decrypt with password preference]");
diff --git a/asn1/ranap/ranap.cnf b/asn1/ranap/ranap.cnf
index 120b41bcaa..33e3900a77 100644
--- a/asn1/ranap/ranap.cnf
+++ b/asn1/ranap/ranap.cnf
@@ -201,7 +201,7 @@ MAX_VAL = asn1_param_get_integer(%(ACTX)s,"upperBound")
&& ! actx->pinfo->sccp_info->data.co.assoc->calling_party ) {
guint len = tvb_length(imsi_tvb);
- guint8* bytes = (guint8 *)ep_tvb_memdup(imsi_tvb,0,len);
+ guint8* bytes = (guint8 *)tvb_memdup(wmem_packet_scope(),imsi_tvb,0,len);
actx->pinfo->sccp_info->data.co.assoc->calling_party =
wmem_strdup_printf(wmem_file_scope(), "IMSI: %%s", bytes_to_str(bytes, len) );
diff --git a/asn1/rrc/rrc.cnf b/asn1/rrc/rrc.cnf
index 5a06d84e49..4ec8384f5e 100644
--- a/asn1/rrc/rrc.cnf
+++ b/asn1/rrc/rrc.cnf
@@ -652,7 +652,7 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE
%(DEFAULT_BODY)s
actx->created_item = proto_tree_add_unicode_string(tree, hf_index, hnbname_tvb, 0, -1,
- tvb_get_ephemeral_string_enc(hnbname_tvb, 0, tvb_length(hnbname_tvb), ENC_UTF_8 | ENC_NA));
+ tvb_get_string_enc(wmem_packet_scope(), hnbname_tvb, 0, tvb_length(hnbname_tvb), ENC_UTF_8 | ENC_NA));
#.FN_BODY CN-DomainIdentity VAL_PTR = &nas_sys_info_gsm_map
guint32 nas_sys_info_gsm_map;
diff --git a/asn1/sabp/packet-sabp-template.c b/asn1/sabp/packet-sabp-template.c
index 0bbfce48b4..81bf989d45 100644
--- a/asn1/sabp/packet-sabp-template.c
+++ b/asn1/sabp/packet-sabp-template.c
@@ -158,7 +158,7 @@ dissect_sabp_cb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (unpacked_tvb != NULL){
if (tree != NULL){
proto_tree *cbs_page_subtree = proto_item_add_subtree(cbs_page_item, ett_sabp_cbs_page_content);
- proto_tree_add_string(cbs_page_subtree, hf_sabp_cbs_page_content, unpacked_tvb, 0, len, tvb_get_ephemeral_string(unpacked_tvb, 0, len));
+ proto_tree_add_string(cbs_page_subtree, hf_sabp_cbs_page_content, unpacked_tvb, 0, len, tvb_get_string(wmem_packet_scope(), unpacked_tvb, 0, len));
}
}
diff --git a/asn1/snmp/packet-snmp-template.c b/asn1/snmp/packet-snmp-template.c
index 64b04f7a85..54b2338d69 100644
--- a/asn1/snmp/packet-snmp-template.c
+++ b/asn1/snmp/packet-snmp-template.c
@@ -430,7 +430,7 @@ dissect_snmp_variable_date_and_time(proto_tree *tree,int hfid, tvbuff_t *tvb, in
minutes,
seconds,
deci_seconds,
- tvb_get_ephemeral_string(tvb,offset+8,1),
+ tvb_get_string(wmem_packet_scope(),tvb,offset+8,1),
hour_from_utc,
min_from_utc);
}else{
@@ -610,7 +610,7 @@ dissect_snmp_VarBind(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset,
pt_name = proto_item_add_subtree(pi_name,ett_name);
/* fetch ObjectName and its relative oid_info */
- oid_bytes = (guint8*)ep_tvb_memdup(tvb, name_offset, name_len);
+ oid_bytes = (guint8*)tvb_memdup(wmem_packet_scope(), tvb, name_offset, name_len);
oid_info = oid_get_from_encoded(oid_bytes, name_len, &subids, &oid_matched, &oid_left);
add_oid_debug_subtree(oid_info,pt_name);
@@ -1406,8 +1406,8 @@ get_user_assoc(tvbuff_t* engine_tvb, tvbuff_t* user_tvb)
given_username_len = tvb_length(user_tvb);
given_engine_len = tvb_length(engine_tvb);
if (! ( given_engine_len && given_username_len ) ) return NULL;
- given_username = (guint8*)ep_tvb_memdup(user_tvb,0,-1);
- given_engine = (guint8*)ep_tvb_memdup(engine_tvb,0,-1);
+ given_username = (guint8*)tvb_memdup(wmem_packet_scope(),user_tvb,0,-1);
+ given_engine = (guint8*)tvb_memdup(wmem_packet_scope(),engine_tvb,0,-1);
for (a = localized_ues; a; a = a->next) {
if ( localized_match(a, given_username, given_username_len, given_engine, given_engine_len) ) {
@@ -1466,10 +1466,10 @@ snmp_usm_auth_md5(snmp_usm_params_t* p, guint8** calc_auth_p, guint* calc_auth_l
*error = "Not enough data remaining";
return FALSE;
}
- msg = (guint8*)ep_tvb_memdup(p->msg_tvb,0,msg_len);
+ msg = (guint8*)tvb_memdup(wmem_packet_scope(),p->msg_tvb,0,msg_len);
- auth = (guint8*)ep_tvb_memdup(p->auth_tvb,0,auth_len);
+ auth = (guint8*)tvb_memdup(wmem_packet_scope(),p->auth_tvb,0,auth_len);
start = p->auth_offset - p->start_offset;
end = start + auth_len;
@@ -1531,9 +1531,9 @@ snmp_usm_auth_sha1(snmp_usm_params_t* p _U_, guint8** calc_auth_p, guint* calc_a
*error = "Not enough data remaining";
return FALSE;
}
- msg = (guint8*)ep_tvb_memdup(p->msg_tvb,0,msg_len);
+ msg = (guint8*)tvb_memdup(wmem_packet_scope(),p->msg_tvb,0,msg_len);
- auth = (guint8*)ep_tvb_memdup(p->auth_tvb,0,auth_len);
+ auth = (guint8*)tvb_memdup(wmem_packet_scope(),p->auth_tvb,0,auth_len);
start = p->auth_offset - p->start_offset;
end = start + auth_len;
@@ -1579,7 +1579,7 @@ snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar c
return NULL;
}
- salt = (guint8*)ep_tvb_memdup(p->priv_tvb,0,salt_len);
+ salt = (guint8*)tvb_memdup(wmem_packet_scope(),p->priv_tvb,0,salt_len);
/*
The resulting "salt" is XOR-ed with the pre-IV to obtain the IV.
@@ -1595,7 +1595,7 @@ snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar c
return NULL;
}
- cryptgrm = (guint8*)ep_tvb_memdup(encryptedData,0,-1);
+ cryptgrm = (guint8*)tvb_memdup(wmem_packet_scope(),encryptedData,0,-1);
cleartext = (guint8*)g_malloc(cryptgrm_len);
@@ -1667,7 +1667,7 @@ snmp_usm_priv_aes_common(snmp_usm_params_t* p, tvbuff_t* encryptedData, gchar co
*error = "Not enough data remaining";
return NULL;
}
- cryptgrm = (guint8*)ep_tvb_memdup(encryptedData,0,-1);
+ cryptgrm = (guint8*)tvb_memdup(wmem_packet_scope(),encryptedData,0,-1);
cleartext = (guint8*)g_malloc(cryptgrm_len);
diff --git a/asn1/t124/t124.cnf b/asn1/t124/t124.cnf
index a49e3820e0..acd15ef7d6 100644
--- a/asn1/t124/t124.cnf
+++ b/asn1/t124/t124.cnf
@@ -154,7 +154,7 @@ RegistryAllocateHandleResponse/result AllocateHandleResponseResult
if(next_tvb) {
- ns = tvb_get_g_string(t124NSIdentifier, 0, tvb_length(t124NSIdentifier));
+ ns = tvb_get_string(NULL, t124NSIdentifier, 0, tvb_length(t124NSIdentifier));
if(ns != NULL) {
dissector_try_string(t124_ns_dissector_table, ns, next_tvb, actx->pinfo, top_tree);
g_free(ns);
diff --git a/asn1/x509sat/x509sat.cnf b/asn1/x509sat/x509sat.cnf
index 0f3f5166b9..bbeab761e3 100644
--- a/asn1/x509sat/x509sat.cnf
+++ b/asn1/x509sat/x509sat.cnf
@@ -385,7 +385,7 @@ XDayOf/fifth fifth_dayof
if (! wide_tvb) {
return offset;
}
- string = tvb_get_ephemeral_unicode_string (wide_tvb, 0, tvb_length(wide_tvb), ENC_BIG_ENDIAN);
+ string = tvb_get_unicode_string (wmem_packet_scope(), wide_tvb, 0, tvb_length(wide_tvb), ENC_BIG_ENDIAN);
proto_item_append_text(actx->created_item, " %s", string);
#.END
diff --git a/doc/README.developer b/doc/README.developer
index 4c5a85307c..b37dfa5417 100644
--- a/doc/README.developer
+++ b/doc/README.developer
@@ -577,8 +577,8 @@ the buffer.
If you're fetching into such a chunk of memory a 2-byte Unicode string
from the buffer, and the string has a specified size, you can use
-"tvb_get_ephemeral_faked_unicode()", which will check whether the entire
-string is present before allocating a buffer for the string, and will also
+"tvb_get_faked_unicode()", which will check whether the entire string
+is present before allocating a buffer for the string, and will also
put a trailing '\0' at the end of the buffer. The resulting string will be
a sequence of single-byte characters; the only Unicode characters that
will be handled correctly are those in the ASCII range. (Wireshark's
diff --git a/doc/README.dissector b/doc/README.dissector
index e5082da767..cc13f265d6 100644
--- a/doc/README.dissector
+++ b/doc/README.dissector
@@ -251,42 +251,24 @@ void tvb_get_guid(tvbuff_t *tvb, const gint offset, e_guid_t *guid, const guint
String accessors:
-guint8 *tvb_get_string(tvbuff_t *tvb, const gint offset, const gint length);
-gchar *tvb_get_unicode_string(tvbuff_t *tvb, const gint offset, gint length, const guint encoding);
-guint8 *tvb_get_ephemeral_string(tvbuff_t *tvb, const gint offset, const gint length);
-guint8 *tvb_get_ephemeral_string_enc(tvbuff_t *tvb, const gint offset, const gint length, const guint encoding);
-gchar *tvb_get_ephemeral_unicode_string(tvbuff_t *tvb, const gint offset, gint length, const guint encoding);
-guint8 *tvb_get_seasonal_string(tvbuff_t *tvb, const gint offset, const gint length);
+guint8 *tvb_get_string(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, const gint length);
+gchar *tvb_get_unicode_string(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, gint length, const guint encoding);
+guint8 *tvb_get_string_enc(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, const gint length, const guint encoding);
Returns a null-terminated buffer containing data from the specified
tvbuff, starting at the specified offset, and containing the specified
length worth of characters (the length of the buffer will be length+1,
as it includes a null character to terminate the string).
-tvb_get_string() returns a buffer allocated by g_malloc() so you must
-g_free() it when you are finished with the string. Failure to g_free() this
-buffer will lead to memory leaks.
+tvb_get_string() returns a buffer allocated by g_malloc() if scope is set
+to NULL (in that case memory must be explicitely freed), or with the
+allocator lifetime if scope is not NULL.
tvb_get_unicode_string() is a unicode (UTF-16) version of above. This
is intended for reading UTF-16 unicode strings out of a tvbuff and
returning them as a UTF-8 string for use in Wireshark. The offset and
returned length pointer are in bytes, not UTF-16 characters.
-tvb_get_ephemeral_string() returns a buffer allocated from a special heap
-with a lifetime until the next packet is dissected. You do not need to
-free() this buffer, it will happen automatically once the next packet is
-dissected.
-
-tvb_get_ephemeral_unicode_string() is a unicode (UTF-16) version of above.
-This is intended for reading UTF-16 unicode strings out of a tvbuff and
-returning them as a UTF-8 string for use in Wireshark. The offset and
-returned length pointer are in bytes, not UTF-16 characters.
-
-tvb_get_seasonal_string() returns a buffer allocated from a special heap
-with a lifetime of the current capture session. You do not need to
-free() this buffer, it will happen automatically once the a new capture or
-file is opened.
-
guint8 *tvb_get_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp);
guint8 *tvb_get_stringz_enc(tvbuff_t *tvb, const gint offset, gint *lengthp, const guint encoding);
const guint8 *tvb_get_const stringz(tvbuff_t *tvb, const gint offset, gint *lengthp);
@@ -327,13 +309,9 @@ with a lifetime of the current capture session. You do not need to
free() this buffer, it will happen automatically once the a new capture or
file is opened.
-tvb_fake_unicode() has been superseded by tvb_get_unicode_string(), which
+tvb_get_faked_unicode() has been superseded by tvb_get_string(), which
properly handles Unicode (UTF-16) strings by converting them to UTF-8.
-tvb_get_ephemeral_faked_unicode() has been superseded by
-tvb_get_ephemeral_string(), which properly handles Unicode (UTF-16) strings by
-converting them to UTF-8.
-
Byte Array Accessors:
gchar *tvb_bytes_to_str(tvbuff_t *tvb, gint offset, gint len);
@@ -366,13 +344,9 @@ guint8* tvb_memcpy(tvbuff_t *tvb, guint8* target, gint offset, gint length);
Copies into the specified target the specified length's worth of data
from the specified tvbuff, starting at the specified offset.
-guint8* tvb_memdup(tvbuff_t *tvb, gint offset, gint length);
-guint8* ep_tvb_memdup(tvbuff_t *tvb, gint offset, gint length);
+guint8* tvb_memdup(wmem_allocator_t *scope, tvbuff_t *tvb, gint offset, gint length);
-Returns a buffer, allocated with "g_malloc()", containing the specified
-length's worth of data from the specified tvbuff, starting at the
-specified offset. The ephemeral variant is freed automatically after the
-packet is dissected.
+Returns a buffer, allocated with "g_malloc()" if scope is NULL, or with the specified pool.
Pointer-retrieval:
/* WARNING! Don't use this function. There is almost always a better way.
diff --git a/epan/dissectors/file-mp4.c b/epan/dissectors/file-mp4.c
index 07e6670dec..53a7060abd 100644
--- a/epan/dissectors/file-mp4.c
+++ b/epan/dissectors/file-mp4.c
@@ -211,7 +211,7 @@ dissect_mp4_box(guint32 parent_box_type _U_,
return -1;
box_type = tvb_get_ntohl(tvb, offset+4);
- box_type_str = tvb_get_ephemeral_string(tvb, offset+4, 4);
+ box_type_str = tvb_get_string(wmem_packet_scope(), tvb, offset+4, 4);
type_pi = proto_tree_add_text(tree, tvb, offset, -1, "%s (%s)",
val_to_str_const(box_type, box_types, "unknown"), box_type_str);
diff --git a/epan/dissectors/packet-9p.c b/epan/dissectors/packet-9p.c
index f99db251f3..d942636e83 100644
--- a/epan/dissectors/packet-9p.c
+++ b/epan/dissectors/packet-9p.c
@@ -1273,7 +1273,7 @@ static int dissect_9P(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
proto_tree_add_item(sub_tree, hf_9P_parmsz, tvb, offset, 2, ENC_LITTLE_ENDIAN);
if (firstpass) {
- tvb_s = tvb_get_g_string(tvb, offset+2, _9p_len);
+ tvb_s = tvb_get_string(NULL, tvb, offset+2, _9p_len);
if (!strncmp(tvb_s, "9P2000.L", _9p_len)) {
u32 = _9P2000_L;
@@ -1363,7 +1363,7 @@ static int dissect_9P(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
sub_tree = proto_item_add_subtree(ti, ett_9P_aname);
proto_tree_add_item(sub_tree, hf_9P_parmsz, tvb, offset, 2, ENC_LITTLE_ENDIAN);
if(firstpass) {
- tvb_s = tvb_get_g_string(tvb, offset+2, _9p_len);
+ tvb_s = tvb_get_string(NULL, tvb, offset+2, _9p_len);
conv_set_fid(pinfo, fid, tvb_s, _9p_len+1);
g_free(tvb_s);
}
@@ -1409,7 +1409,7 @@ static int dissect_9P(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
}
if (firstpass) {
- tvb_s = tvb_get_g_string(tvb, offset+2, _9p_len);
+ tvb_s = tvb_get_string(NULL, tvb, offset+2, _9p_len);
wmem_strbuf_append_c(tmppath, '/');
wmem_strbuf_append(tmppath, tvb_s);
g_free(tvb_s);
@@ -1484,7 +1484,7 @@ static int dissect_9P(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
tmppath = wmem_strbuf_sized_new(wmem_packet_scope(), 0, MAXPATHLEN);
wmem_strbuf_append(tmppath, fid_path);
wmem_strbuf_append_c(tmppath, '/');
- tvb_s = tvb_get_g_string(tvb, offset+2, _9p_len);
+ tvb_s = tvb_get_string(NULL, tvb, offset+2, _9p_len);
wmem_strbuf_append(tmppath, tvb_s);
g_free(tvb_s);
}
@@ -1519,7 +1519,7 @@ static int dissect_9P(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
tmppath = wmem_strbuf_sized_new(wmem_packet_scope(), 0, MAXPATHLEN);
wmem_strbuf_append(tmppath, fid_path);
wmem_strbuf_append_c(tmppath, '/');
- tvb_s = tvb_get_g_string(tvb, offset+2, _9p_len);
+ tvb_s = tvb_get_string(NULL, tvb, offset+2, _9p_len);
wmem_strbuf_append(tmppath, tvb_s);
g_free(tvb_s);
}
@@ -1935,7 +1935,7 @@ static int dissect_9P(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
wmem_strbuf_append(tmppath, conv_get_fid(pinfo, dfid));
wmem_strbuf_append_c(tmppath, '/');
- tvb_s = tvb_get_g_string(tvb, offset+2, _9p_len);
+ tvb_s = tvb_get_string(NULL, tvb, offset+2, _9p_len);
wmem_strbuf_append(tmppath, tvb_s);
g_free(tvb_s);
diff --git a/epan/dissectors/packet-aastra-aasp.c b/epan/dissectors/packet-aastra-aasp.c
index fbace8d1f4..d5b11e19c8 100644
--- a/epan/dissectors/packet-aastra-aasp.c
+++ b/epan/dissectors/packet-aastra-aasp.c
@@ -217,7 +217,7 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
proto_tree_add_item(subtree, hf_a_length, tvb, 4, 1, ENC_NA);
proto_tree_add_item(subtree, hf_a_text, tvb, 5, -1, ENC_ASCII|ENC_NA);
- pstr = tvb_get_ephemeral_string(tvb, 5, tvb_get_guint8(tvb, 4));
+ pstr = tvb_get_string(wmem_packet_scope(), tvb, 5, tvb_get_guint8(tvb, 4));
if(pstr)
{
proto_item_append_text(ti, ": '%s'", pstr);
@@ -283,7 +283,7 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
ti = proto_tree_add_item(subtree, hf_a_item, tvb, i, len+2, ENC_NA);
infotree = proto_item_add_subtree(ti, ett_a_item);
proto_tree_add_item(infotree, hf_a_weekday, tvb, i+2, len, ENC_ASCII|ENC_NA);
- pstr = tvb_get_ephemeral_string(tvb, i+2, len);
+ pstr = tvb_get_string(wmem_packet_scope(), tvb, i+2, len);
if(pstr)
proto_item_append_text(ti, ", Weekday: '%s'", pstr);
@@ -296,7 +296,7 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
ti = proto_tree_add_item(subtree, hf_a_item, tvb, i, len+2, ENC_NA);
infotree = proto_item_add_subtree(ti, ett_a_item);
proto_tree_add_item(infotree, hf_a_month_name, tvb, i+2, len, ENC_ASCII|ENC_NA);
- pstr = tvb_get_ephemeral_string(tvb, i+2, len);
+ pstr = tvb_get_string(wmem_packet_scope(), tvb, i+2, len);
if(pstr)
proto_item_append_text(ti, ", Month name: '%s'", pstr);
i += len +2;
@@ -308,7 +308,7 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
ti = proto_tree_add_item(subtree, hf_a_item, tvb, i, len+2, ENC_NA);
infotree = proto_item_add_subtree(ti, ett_a_item);
proto_tree_add_item(infotree, hf_a_weekofyear_prefix, tvb, i+2, len, ENC_ASCII|ENC_NA);
- pstr = tvb_get_ephemeral_string(tvb, i+2, len);
+ pstr = tvb_get_string(wmem_packet_scope(), tvb, i+2, len);
if(pstr)
proto_item_append_text(ti, ", Week of the year prefix: '%s'", pstr);
i += len +2;
@@ -355,7 +355,7 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
proto_tree_add_item(subtree, hf_a_length, tvb, 2, 1, ENC_NA);
proto_tree_add_item(subtree, hf_a_cdpn, tvb, 3, -1, ENC_ASCII|ENC_NA);
- pstr = tvb_get_ephemeral_string(tvb, 3, tvb_get_guint8(tvb, 2));
+ pstr = tvb_get_string(wmem_packet_scope(), tvb, 3, tvb_get_guint8(tvb, 2));
if(pstr)
proto_item_append_text(ti, ": '%s'", pstr);
}
diff --git a/epan/dissectors/packet-adwin-config.c b/epan/dissectors/packet-adwin-config.c
index 8db659ff55..7309b7cc0b 100644
--- a/epan/dissectors/packet-adwin-config.c
+++ b/epan/dissectors/packet-adwin-config.c
@@ -218,13 +218,13 @@ dissect_UDPExtStatus(tvbuff_t *tvb, proto_tree *adwin_tree)
/* add the processor type raw values to the tree, to allow filtering */
ADWIN_ADD_LE(adwin_tree, processor_type, 64, 2);
/* add the processor type as a pretty printed string */
- processor_type = tvb_get_ephemeral_string(tvb, 64, 2);
+ processor_type = tvb_get_string(wmem_packet_scope(), tvb, 64, 2);
processor_type = str_to_str(processor_type, processor_type_mapping, "Unknown (%s)");
proto_tree_add_text(adwin_tree, tvb, 64, 2, "Processor Type: %s", processor_type);
/* add system type as raw value and pretty printed string */
ADWIN_ADD_LE(adwin_tree, system_type, 66, 2);
- system_type = tvb_get_ephemeral_string(tvb, 66, 2);
+ system_type = tvb_get_string(wmem_packet_scope(), tvb, 66, 2);
system_type = str_to_str(system_type, system_type_mapping, "Unknown (%s)");
proto_tree_add_text(adwin_tree, tvb, 66, 2, "System Type: %s", system_type);
@@ -261,13 +261,13 @@ dissect_UDPMessage(tvbuff_t *tvb, proto_tree *adwin_tree)
/* add the processor type raw values to the tree, to allow filtering */
ADWIN_ADD_LE(adwin_tree, processor_type, 96, 2);
/* add the processor type as a pretty printed string */
- processor_type = tvb_get_ephemeral_string(tvb, 96, 2);
+ processor_type = tvb_get_string(wmem_packet_scope(), tvb, 96, 2);
processor_type = str_to_str(processor_type, processor_type_mapping, "Unknown");
proto_tree_add_text(adwin_tree, tvb, 96, 2, "Processor Type: %s", processor_type);
/* add system type as raw value and pretty printed string */
ADWIN_ADD_LE(adwin_tree, system_type, 98, 2);
- system_type = tvb_get_ephemeral_string(tvb, 98, 2);
+ system_type = tvb_get_string(wmem_packet_scope(), tvb, 98, 2);
system_type = str_to_str(system_type, system_type_mapping, "Unknown");
proto_tree_add_text(adwin_tree, tvb, 98, 2, "System Type: %s", system_type);
}
@@ -341,7 +341,7 @@ dissect_TCPFlashUpdate(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *adwin
ADWIN_ADD_BE(adwin_tree, stream_length, 0, 4);
offset = 4;
length = tvb_strnlen(tvb, offset, -1) + 1;
- filename = tvb_get_ephemeral_string(tvb, offset, length);
+ filename = tvb_get_string(wmem_packet_scope(), tvb, offset, length);
if (strncmp(filename, "eeprom_on", length) == 0) {
proto_tree_add_text(adwin_tree, tvb, offset, length,
"Enable EEPROM Support");
diff --git a/epan/dissectors/packet-afp.c b/epan/dissectors/packet-afp.c
index 03c723b081..e042b0e7ed 100644
--- a/epan/dissectors/packet-afp.c
+++ b/epan/dissectors/packet-afp.c
@@ -1714,7 +1714,7 @@ name_in_bitmap(tvbuff_t *tvb, gint offset, guint16 bitmap, int isdir)
tp_ofs = nameoff +org_offset;
len = tvb_get_guint8(tvb, tp_ofs);
tp_ofs++;
- name = tvb_get_ephemeral_string(tvb, tp_ofs, len);
+ name = tvb_get_string(wmem_packet_scope(), tvb, tp_ofs, len);
return name;
}
offset += 2;
@@ -1752,7 +1752,7 @@ name_in_bitmap(tvbuff_t *tvb, gint offset, guint16 bitmap, int isdir)
tp_ofs = nameoff +org_offset +4;
len16 = tvb_get_ntohs(tvb, tp_ofs);
tp_ofs += 2;
- name = tvb_get_ephemeral_string(tvb, tp_ofs, len16);
+ name = tvb_get_string(wmem_packet_scope(), tvb, tp_ofs, len16);
return name;
}
}
@@ -2520,7 +2520,7 @@ dissect_query_afp_login(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
proto_tree_add_item(tree, hf_afp_Version, tvb, offset, 1, ENC_UTF_8|ENC_BIG_ENDIAN);
offset += len +1;
len_uam = tvb_get_guint8(tvb, offset);
- uam = tvb_get_ephemeral_string(tvb, offset +1, len_uam);
+ uam = tvb_get_string(wmem_packet_scope(), tvb, offset +1, len_uam);
proto_tree_add_item(tree, hf_afp_UAM, tvb, offset, 1, ENC_UTF_8|ENC_BIG_ENDIAN);
offset += len_uam +1;
@@ -2553,7 +2553,7 @@ dissect_query_afp_login_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t
offset += len +1;
len_uam = tvb_get_guint8(tvb, offset);
- uam = tvb_get_ephemeral_string(tvb, offset +1, len_uam);
+ uam = tvb_get_string(wmem_packet_scope(), tvb, offset +1, len_uam);
proto_tree_add_item(tree, hf_afp_UAM, tvb, offset, 1, ENC_UTF_8|ENC_BIG_ENDIAN);
offset += len_uam +1;
@@ -4252,7 +4252,7 @@ spotlight_dissect_query_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
"%s, toc index: %u, string: '%s'",
spotlight_get_cpx_qtype_string(complex_query_type),
toc_index + 1,
- tvb_get_ephemeral_string(tvb, offset + 16, query_length - 8));
+ tvb_get_string(wmem_packet_scope(), tvb, offset + 16, query_length - 8));
break;
case SQ_CPX_TYPE_UTF16_STRING:
/*
@@ -4274,7 +4274,7 @@ spotlight_dissect_query_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
"%s, toc index: %u, utf-16 string: '%s'",
spotlight_get_cpx_qtype_string(complex_query_type),
toc_index + 1,
- tvb_get_ephemeral_unicode_string(tvb, offset + (mark_exists ? 18 : 16),
+ tvb_get_unicode_string(wmem_packet_scope(), tvb, offset + (mark_exists ? 18 : 16),
query_length - (mark_exists? 10 : 8), unicode_encoding));
break;
default:
@@ -4342,7 +4342,7 @@ spotlight_dissect_query_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
switch (cpx_query_type) {
case SQ_CPX_TYPE_STRING:
proto_tree_add_text(tree, tvb, offset, query_length, "string: '%s'",
- tvb_get_ephemeral_string(tvb, offset + 8, query_length - 8));
+ tvb_get_string(wmem_packet_scope(), tvb, offset + 8, query_length - 8));
break;
case SQ_CPX_TYPE_UTF16_STRING: {
/* description see above */
@@ -4351,7 +4351,7 @@ spotlight_dissect_query_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
unicode_encoding &= ~ENC_UTF_16;
proto_tree_add_text(tree, tvb, offset, query_length, "utf-16 string: '%s'",
- tvb_get_ephemeral_unicode_string(tvb, offset + (mark_exists ? 10 : 8),
+ tvb_get_unicode_string(wmem_packet_scope(), tvb, offset + (mark_exists ? 10 : 8),
query_length - (mark_exists? 10 : 8), unicode_encoding));
break;
}
@@ -4412,7 +4412,7 @@ dissect_spotlight(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offs
proto_item *item_toc;
proto_tree *sub_tree_toc;
- if (strncmp(tvb_get_ephemeral_string(tvb, offset, 8), "md031234", 8) == 0)
+ if (strncmp(tvb_get_string(wmem_packet_scope(), tvb, offset, 8), "md031234", 8) == 0)
encoding = ENC_BIG_ENDIAN;
else
encoding = ENC_LITTLE_ENDIAN;
diff --git a/epan/dissectors/packet-aim-messaging.c b/epan/dissectors/packet-aim-messaging.c
index 1655b6853b..365b64e739 100644
--- a/epan/dissectors/packet-aim-messaging.c
+++ b/epan/dissectors/packet-aim-messaging.c
@@ -507,7 +507,7 @@ dissect_aim_rendezvous_extended_message(tvbuff_t *tvb, proto_tree *msg_tree)
proto_tree_add_item(msg_tree, hf_aim_rendezvous_extended_data_message_priority_code, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2;
text_length = tvb_get_letohs(tvb, offset);
proto_tree_add_item(msg_tree, hf_aim_rendezvous_extended_data_message_text_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2;
- text = tvb_get_ephemeral_string(tvb, offset, text_length);
+ text = tvb_get_string(wmem_packet_scope(), tvb, offset, text_length);
proto_tree_add_text(msg_tree, tvb, offset, text_length, "Text: %s", text); /* offset+=text_length; */
offset = tvb_length(tvb);
diff --git a/epan/dissectors/packet-aim.c b/epan/dissectors/packet-aim.c
index 3657c1de25..963108208e 100644
--- a/epan/dissectors/packet-aim.c
+++ b/epan/dissectors/packet-aim.c
@@ -1167,7 +1167,7 @@ dissect_aim_tlv_value_string (proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb
gint string_len;
string_len = tvb_length(tvb);
- buf = tvb_get_ephemeral_string(tvb, 0, string_len);
+ buf = tvb_get_string(wmem_packet_scope(), tvb, 0, string_len);
proto_item_set_text(ti, "Value: %s", format_text(buf, string_len));
return string_len;
@@ -1184,7 +1184,7 @@ dissect_aim_tlv_value_string08_array (proto_item *ti, guint16 valueid _U_, tvbuf
while (tvb_reported_length_remaining(tvb, offset) > 1)
{
guint8 string_len = tvb_get_guint8(tvb, offset++);
- guint8 *buf = tvb_get_ephemeral_string(tvb, offset, string_len);
+ guint8 *buf = tvb_get_string(wmem_packet_scope(), tvb, offset, string_len);
proto_tree_add_text(entry, tvb, offset, string_len, "%s",
format_text(buf, string_len));
offset += string_len;
@@ -1289,7 +1289,7 @@ dissect_aim_tlv_value_messageblock (proto_item *ti, guint16 valueid _U_, tvbuff_
offset += 2;
/* The actual message */
- buf = tvb_get_ephemeral_string(tvb, offset, blocklen - 4);
+ buf = tvb_get_string(wmem_packet_scope(), tvb, offset, blocklen - 4);
proto_item_append_text(ti, "Message: %s ",
format_text(buf, blocklen - 4));
proto_tree_add_item(entry, hf_aim_messageblock_message, tvb,
diff --git a/epan/dissectors/packet-alcap.c b/epan/dissectors/packet-alcap.c
index ecab444293..66b8873301 100644
--- a/epan/dissectors/packet-alcap.c
+++ b/epan/dissectors/packet-alcap.c
@@ -544,7 +544,7 @@ static const gchar* dissect_fields_desea(packet_info* pinfo _U_, tvbuff_t *tvb,
e164->e164_number_type = CALLED_PARTY_NUMBER;
e164->nature_of_address = tvb_get_guint8(tvb,offset) & 0x7f;
- e164->E164_number_str = (gchar*)tvb_get_ephemeral_string(tvb,offset+1,len);
+ e164->E164_number_str = (gchar*)tvb_get_string(wmem_packet_scope(),tvb,offset+1,len);
e164->E164_number_length = len-1;
dissect_e164_number(tvb, tree, offset-1, len, *e164);
@@ -570,7 +570,7 @@ static const gchar* dissect_fields_oesea(packet_info* pinfo _U_, tvbuff_t *tvb,
e164->e164_number_type = CALLING_PARTY_NUMBER;
e164->nature_of_address = tvb_get_guint8(tvb,offset) & 0x7f;
- e164->E164_number_str = (gchar*)tvb_get_ephemeral_string(tvb,offset+1,len);
+ e164->E164_number_str = (gchar*)tvb_get_string(wmem_packet_scope(),tvb,offset+1,len);
e164->E164_number_length = len-1;
dissect_e164_number(tvb, tree, offset-1, len, *e164);
diff --git a/epan/dissectors/packet-amqp.c b/epan/dissectors/packet-amqp.c
index 2af29042e1..fa388aab07 100644
--- a/epan/dissectors/packet-amqp.c
+++ b/epan/dissectors/packet-amqp.c
@@ -1960,7 +1960,7 @@ dissect_amqp_0_9_field_table(tvbuff_t *tvb, packet_info *pinfo, int offset, guin
length -= 1;
if (length < namelen)
goto too_short;
- name = (char*) tvb_get_ephemeral_string(tvb, offset, namelen);
+ name = (char*) tvb_get_string(wmem_packet_scope(), tvb, offset, namelen);
offset += namelen;
length -= namelen;
if (length < 1)
@@ -1978,7 +1978,7 @@ dissect_amqp_0_9_field_table(tvbuff_t *tvb, packet_info *pinfo, int offset, guin
length -= 4;
if (length < vallen)
goto too_short;
- value = (char*) tvb_get_ephemeral_string(tvb, offset, vallen);
+ value = (char*) tvb_get_string(wmem_packet_scope(), tvb, offset, vallen);
offset += vallen;
length -= vallen;
break;
@@ -2092,7 +2092,7 @@ dissect_amqp_0_10_map(tvbuff_t *tvb,
namelen = tvb_get_guint8(tvb, offset);
AMQP_INCREMENT(offset, 1, bound);
length -= 1;
- name = (char*) tvb_get_ephemeral_string(tvb, offset, namelen);
+ name = (char*) tvb_get_string(wmem_packet_scope(), tvb, offset, namelen);
AMQP_INCREMENT(offset, namelen, bound);
length -= namelen;
type = tvb_get_guint8(tvb, offset);
@@ -2209,7 +2209,7 @@ dissect_amqp_0_10_array(tvbuff_t *tvb,
len16 = tvb_get_ntohs(tvb, offset);
AMQP_INCREMENT(offset, 2, bound);
length -= 2;
- value = (char*) tvb_get_ephemeral_string(tvb, offset, len16);
+ value = (char*) tvb_get_string(wmem_packet_scope(), tvb, offset, len16);
AMQP_INCREMENT(offset, len16, bound);
length -= len16;
break;
@@ -8627,7 +8627,7 @@ format_amqp_0_10_str(tvbuff_t *tvb,
return length;
}
AMQP_INCREMENT(offset, length, bound);
- *value = tvb_get_ephemeral_string(tvb, offset, string_length);
+ *value = tvb_get_string(wmem_packet_scope(), tvb, offset, string_length);
AMQP_INCREMENT(offset, string_length, bound);
return (string_length + length);
}
diff --git a/epan/dissectors/packet-ansi_a.c b/epan/dissectors/packet-ansi_a.c
index ae5b4f3786..f07fd4c3aa 100644
--- a/epan/dissectors/packet-ansi_a.c
+++ b/epan/dissectors/packet-ansi_a.c
@@ -1969,7 +1969,7 @@ elem_mid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset
a_bigbuf[0] = Dgt_meid.out[(oct & 0xf0) >> 4];
curr_offset++;
- poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
+ poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, len - (curr_offset - offset));
my_dgt_tbcd_unpack(&a_bigbuf[1], poctets, len - (curr_offset - offset),
&Dgt_meid);
@@ -2176,7 +2176,7 @@ elem_mid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset
a_bigbuf[0] = Dgt_msid.out[(oct & 0xf0) >> 4];
curr_offset++;
- poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
+ poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, len - (curr_offset - offset));
my_dgt_tbcd_unpack(&a_bigbuf[1], poctets, len - (curr_offset - offset),
&Dgt_msid);
@@ -3778,7 +3778,7 @@ elem_clg_party_ascii_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
curr_offset++;
}
- poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
+ poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, len - (curr_offset - offset));
proto_tree_add_string_format(tree, hf_ansi_a_clg_party_ascii_num,
tvb, curr_offset, len - (curr_offset - offset),
@@ -4321,7 +4321,7 @@ elem_cld_party_bcd_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
curr_offset++;
- poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
+ poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, len - (curr_offset - offset));
my_dgt_tbcd_unpack(a_bigbuf, poctets, len - (curr_offset - offset),
&Dgt_tbcd);
@@ -4458,7 +4458,7 @@ elem_clg_party_bcd_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
curr_offset++;
}
- poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
+ poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, len - (curr_offset - offset));
my_dgt_tbcd_unpack(a_bigbuf, poctets, len - (curr_offset - offset),
&Dgt_tbcd);
@@ -6704,7 +6704,7 @@ elem_rev_ms_info_recs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, g
switch (rec_type)
{
case ANSI_REV_MS_INFO_REC_KEYPAD_FAC:
- poctets = tvb_get_ephemeral_string(tvb, curr_offset, oct_len);
+ poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, oct_len);
proto_tree_add_string_format(subtree, hf_ansi_a_cld_party_ascii_num,
tvb, curr_offset, oct_len,
@@ -7528,7 +7528,7 @@ elem_cld_party_ascii_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
curr_offset++;
- poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
+ poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, len - (curr_offset - offset));
proto_tree_add_string_format(tree, hf_ansi_a_cld_party_ascii_num,
tvb, curr_offset, len - (curr_offset - offset),
@@ -12064,7 +12064,7 @@ dissect_sip_dtap_bsmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (linelen >= 2) {
ansi_a_tvb = tvb_new_composite();
msg_type = (guint8*)wmem_alloc(pinfo->pool, 1);
- msg_type[0] = (guint8)strtoul(tvb_get_ephemeral_string(tvb, offset, 2), NULL, 16);
+ msg_type[0] = (guint8)strtoul(tvb_get_string(wmem_packet_scope(), tvb, offset, 2), NULL, 16);
if ((begin = tvb_find_guint8(tvb, offset, linelen, '"')) > 0) {
if (tvb_get_guint8(tvb, begin + 1) == '1') {
is_dtap = FALSE;
@@ -12079,7 +12079,7 @@ dissect_sip_dtap_bsmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
while ((linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, TRUE)) > 0) {
if ((begin = tvb_find_guint8(tvb, offset, linelen, '=')) > 0) {
begin++;
- tvb_composite_append(ansi_a_tvb, base64_to_tvb(tvb, tvb_get_ephemeral_string(tvb, begin, offset + linelen - begin)));
+ tvb_composite_append(ansi_a_tvb, base64_to_tvb(tvb, tvb_get_string(wmem_packet_scope(), tvb, begin, offset + linelen - begin)));
}
offset = next_offset;
}
diff --git a/epan/dissectors/packet-ansi_map.c b/epan/dissectors/packet-ansi_map.c
index f50ec20957..e957915ccf 100644
--- a/epan/dissectors/packet-ansi_map.c
+++ b/epan/dissectors/packet-ansi_map.c
@@ -1493,7 +1493,7 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
return;
offset++;
proto_tree_add_item(subtree, hf_ansi_map_ia5_digits, tvb, offset, -1, ENC_ASCII|ENC_NA);
- proto_item_append_text(actx->created_item, " - %s", tvb_get_ephemeral_string(tvb,offset,tvb_length_remaining(tvb,offset)));
+ proto_item_append_text(actx->created_item, " - %s", tvb_get_string(wmem_packet_scope(),tvb,offset,tvb_length_remaining(tvb,offset)));
break;
case 3:
/* Octet string */
@@ -1526,7 +1526,7 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
case 2:
/* IA5 Coding */
proto_tree_add_item(subtree, hf_ansi_map_ia5_digits, tvb, offset, -1, ENC_ASCII|ENC_NA);
- proto_item_append_text(actx->created_item, " - %s", tvb_get_ephemeral_string(tvb,offset,tvb_length_remaining(tvb,offset)));
+ proto_item_append_text(actx->created_item, " - %s", tvb_get_string(wmem_packet_scope(),tvb,offset,tvb_length_remaining(tvb,offset)));
break;
case 3:
/* Octet string */
diff --git a/epan/dissectors/packet-applemidi.c b/epan/dissectors/packet-applemidi.c
index 084916545d..15abcec58c 100644
--- a/epan/dissectors/packet-applemidi.c
+++ b/epan/dissectors/packet-applemidi.c
@@ -170,7 +170,7 @@ dissect_applemidi_common( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
/* Name is optional */
if ( len > 0 ) {
- name = tvb_get_ephemeral_string( tvb, offset, len );
+ name = tvb_get_string( wmem_packet_scope(), tvb, offset, len );
string_size = (gint)( strlen( name ) + 1 );
proto_tree_add_item( applemidi_tree, hf_applemidi_name, tvb, offset, string_size, ENC_UTF_8|ENC_NA );
col_append_fstr( pinfo->cinfo, COL_INFO, ": peer = \"%s\"", name );
diff --git a/epan/dissectors/packet-aprs.c b/epan/dissectors/packet-aprs.c
index ad36513527..1b26a15296 100644
--- a/epan/dissectors/packet-aprs.c
+++ b/epan/dissectors/packet-aprs.c
@@ -997,7 +997,7 @@ dissect_aprs_weather( tvbuff_t *tvb,
lr = new_offset - offset;
#if 0 /* fcn'al change: defer */
if ( ((lr < 3) || (lr > 5)) ||
- ( lr != strspn( tvb_get_ephemeral_string( tvb, offset, lr ), "a-zA-Z0-9-_" ) ) )
+ ( lr != strspn( tvb_get_string( wmem_packet_scope(), tvb, offset, lr ), "a-zA-Z0-9-_" ) ) )
{
new_offset = offset; /* Assume rest is a comment: force exit from while */
break; /* from switch */
@@ -1129,7 +1129,7 @@ aprs_item( proto_tree *aprs_tree, tvbuff_t *tvb, int offset )
data_len = 10;
- info_buffer = tvb_get_ephemeral_string( tvb, offset, data_len );
+ info_buffer = tvb_get_string( wmem_packet_scope(), tvb, offset, data_len );
ch_ptr = strchr( info_buffer, '!' );
if ( ch_ptr != NULL )
diff --git a/epan/dissectors/packet-ar_drone.c b/epan/dissectors/packet-ar_drone.c
index 13492b2133..8c788b56d8 100644
--- a/epan/dissectors/packet-ar_drone.c
+++ b/epan/dissectors/packet-ar_drone.c
@@ -129,7 +129,7 @@ dissect_ar_drone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
return 0;
/* Make sure the packet we're dissecting is a ar_drone packet */
- if(strcmp(tvb_get_ephemeral_string(tvb,0,3),"AT*"))
+ if(strcmp(tvb_get_string(wmem_packet_scope(),tvb,0,3),"AT*"))
return 0;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ar_drone");
@@ -146,9 +146,9 @@ dissect_ar_drone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
if (offset < master_offset)
return master_offset;
- command = tvb_get_ephemeral_string(tvb, master_offset, offset-master_offset);
+ command = tvb_get_string(wmem_packet_scope(), tvb, master_offset, offset-master_offset);
sub_item = proto_tree_add_string(ar_tree, hf_command, tvb, master_offset, -1,
- tvb_get_ephemeral_string(tvb, master_offset+3, offset-master_offset-3));
+ tvb_get_string(wmem_packet_scope(), tvb, master_offset+3, offset-master_offset-3));
if(!strncmp(command,"AT*PCMD",7))
{
@@ -541,7 +541,7 @@ dissect_ar_drone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
}
ti = proto_tree_add_item(sub_tree, hf_CTRL_mode, tvb, offset, length, ENC_ASCII|ENC_NA);
proto_item_append_text(ti, "%s",
- str_to_str(tvb_get_ephemeral_string(tvb, offset, length), CTRL_mode_vs, " (Unknown Mode)"));
+ str_to_str(tvb_get_string(wmem_packet_scope(), tvb, offset, length), CTRL_mode_vs, " (Unknown Mode)"));
offset += (length + 1);
/* Add File Size */
diff --git a/epan/dissectors/packet-artnet.c b/epan/dissectors/packet-artnet.c
index b93311f368..f5d44ad449 100644
--- a/epan/dissectors/packet-artnet.c
+++ b/epan/dissectors/packet-artnet.c
@@ -2456,7 +2456,7 @@ dissect_artnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
}
col_append_fstr(pinfo->cinfo, COL_INFO, "%s",
- tvb_get_ephemeral_string(tvb, offset, 8));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, 8));
if (tree) {
proto_tree_add_item(artnet_header_tree, hf_artnet_header_id,
tvb, offset, 8, ENC_ASCII|ENC_NA);
diff --git a/epan/dissectors/packet-asap.c b/epan/dissectors/packet-asap.c
index 90649dc278..e843994858 100644
--- a/epan/dissectors/packet-asap.c
+++ b/epan/dissectors/packet-asap.c
@@ -491,7 +491,7 @@ dissect_pool_handle_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tre
handle_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
pi = proto_tree_add_item(parameter_tree, hf_pool_handle, parameter_tvb, POOL_HANDLE_OFFSET, handle_length, ENC_NA);
- tmp = (gchar*)tvb_get_ephemeral_string(parameter_tvb, POOL_HANDLE_OFFSET, handle_length);
+ tmp = (gchar*)tvb_get_string(wmem_packet_scope(), parameter_tvb, POOL_HANDLE_OFFSET, handle_length);
proto_item_append_text(pi, " (%s)", tmp);
}
diff --git a/epan/dissectors/packet-assa_r3.c b/epan/dissectors/packet-assa_r3.c
index 635abd33a7..7c2939be13 100644
--- a/epan/dissectors/packet-assa_r3.c
+++ b/epan/dissectors/packet-assa_r3.c
@@ -3495,25 +3495,25 @@ dissect_serialnumber (tvbuff_t *tvb, guint32 start_offset, guint32 length _U_, p
sn_item = proto_tree_add_item (tree, hf_index, tvb, start_offset, 16, ENC_ASCII|ENC_NA);
sn_tree = proto_item_add_subtree (sn_item, ett_r3serialnumber);
- s = tvb_get_ephemeral_string (tvb, start_offset + 0, 2);
+ s = tvb_get_string (wmem_packet_scope(), tvb, start_offset + 0, 2);
proto_tree_add_text (sn_tree, tvb, start_offset + 0, 2, "Manufacturer .. : %s (%s)", s, str_to_str (s, r3_snmanufacturernames, "[Unknown]"));
- s = tvb_get_ephemeral_string (tvb, start_offset + 2, 1);
+ s = tvb_get_string (wmem_packet_scope(), tvb, start_offset + 2, 1);
proto_tree_add_text (sn_tree, tvb, start_offset + 2, 1, "Year .......... : %s (%s)", s, str_to_str (s, r3_snyearnames, "[Unknown]"));
- s = tvb_get_ephemeral_string (tvb, start_offset + 3, 2);
+ s = tvb_get_string (wmem_packet_scope(), tvb, start_offset + 3, 2);
proto_tree_add_text (sn_tree, tvb, start_offset + 3, 2, "Week .......... : %s", s);
- s = tvb_get_ephemeral_string (tvb, start_offset + 5, 1);
+ s = tvb_get_string (wmem_packet_scope(), tvb, start_offset + 5, 1);
proto_tree_add_text (sn_tree, tvb, start_offset + 5, 1, "Model ......... : %s (%s)", s, str_to_str (s, r3_snmodelnames, "[Unknown]"));
- s = tvb_get_ephemeral_string (tvb, start_offset + 6, 4);
+ s = tvb_get_string (wmem_packet_scope(), tvb, start_offset + 6, 4);
proto_tree_add_text (sn_tree, tvb, start_offset + 6, 4, "Sequence ...... : %s", s);
- s = tvb_get_ephemeral_string (tvb, start_offset + 10, 1);
+ s = tvb_get_string (wmem_packet_scope(), tvb, start_offset + 10, 1);
proto_tree_add_text (sn_tree, tvb, start_offset + 10, 1, "Group ......... : %s (%s)", s, str_to_str (s, r3_sngroupnames, "[Unknown]"));
- s = tvb_get_ephemeral_string (tvb, start_offset + 11, 1);
+ s = tvb_get_string (wmem_packet_scope(), tvb, start_offset + 11, 1);
proto_tree_add_text (sn_tree, tvb, start_offset + 11, 1, "NID ........... : %s (%s)", s, str_to_str (s, r3_snnidnames, "[Unknown]"));
- s = tvb_get_ephemeral_string (tvb, start_offset + 12, 2);
+ s = tvb_get_string (wmem_packet_scope(), tvb, start_offset + 12, 2);
proto_tree_add_text (sn_tree, tvb, start_offset + 12, 2, "HID ........... : %s (%s)", s, str_to_str (s, r3_snhidnames, "[Unknown]"));
- s = tvb_get_ephemeral_string (tvb, start_offset + 14, 1);
+ s = tvb_get_string (wmem_packet_scope(), tvb, start_offset + 14, 1);
proto_tree_add_text (sn_tree, tvb, start_offset + 14, 1, "Power Supply .. : %s (%s)", s, str_to_str (s, r3_snpowersupplynames, "[Unknown]"));
- s = tvb_get_ephemeral_string (tvb, start_offset + 15, 1);
+ s = tvb_get_string (wmem_packet_scope(), tvb, start_offset + 15, 1);
proto_tree_add_text (sn_tree, tvb, start_offset + 15, 1, "Mortise ....... : %s (%s)", s, str_to_str (s, r3_snmortisenames, "[Unknown]"));
}
diff --git a/epan/dissectors/packet-atalk.c b/epan/dissectors/packet-atalk.c
index 5dd9a0b5a1..2b9f36c426 100644
--- a/epan/dissectors/packet-atalk.c
+++ b/epan/dissectors/packet-atalk.c
@@ -572,7 +572,7 @@ static int dissect_pascal_string(tvbuff_t *tvb, int offset, proto_tree *tree,
* code, we could perhaps avoid allocating and freeing
* this string buffer.
*/
- tmp = (gchar*)tvb_get_ephemeral_string(tvb, offset, len);
+ tmp = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, offset, len);
item = proto_tree_add_string(tree, hf_index, tvb, offset-1, len+1, tmp);
subtree = proto_item_add_subtree(item, ett_pstring);
@@ -1126,7 +1126,7 @@ dissect_asp_reply_get_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
break;
case 4: /* DNS */
if (len > 2) {
- tmp = (gchar*)tvb_get_ephemeral_string(tvb, ofs +2, len -2);
+ tmp = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, ofs +2, len -2);
ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "dns %s", tmp);
break;
}
@@ -1162,7 +1162,7 @@ dissect_asp_reply_get_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
ofs = utf_ofs;
ulen = tvb_get_ntohs(tvb, ofs);
- tmp = (gchar*)tvb_get_ephemeral_string(tvb, ofs + 2, ulen);
+ tmp = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, ofs + 2, ulen);
ti = proto_tree_add_text(tree, tvb, ofs, ulen +2, "UTF8 server name: %s", tmp);
sub_tree = proto_item_add_subtree(ti, ett_asp_utf8_name);
proto_tree_add_uint(sub_tree, hf_asp_server_utf8_name_len, tvb, ofs, 2, ulen);
diff --git a/epan/dissectors/packet-bacapp.c b/epan/dissectors/packet-bacapp.c
index 63bd1bc674..2305ac6981 100644
--- a/epan/dissectors/packet-bacapp.c
+++ b/epan/dissectors/packet-bacapp.c
@@ -6268,7 +6268,7 @@ fCharacterString (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
* other dissectors need to handle various
* character encodings.
*/
- str_val = tvb_get_ephemeral_string(tvb, offset, l);
+ str_val = tvb_get_string(wmem_packet_scope(), tvb, offset, l);
/** this decoding may be not correct for multi-byte characters, Lka */
switch (character_set) {
case ANSI_X34:
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index 66a810cc5c..07758ccb1b 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -4507,7 +4507,7 @@ dissect_ber_GeneralizedTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree
return end_offset;
}
- tmpstr = tvb_get_ephemeral_string(tvb, offset, len);
+ tmpstr = tvb_get_string(wmem_packet_scope(), tvb, offset, len);
strptr = str;
/* those fields are allways present */
strptr += g_snprintf(str, 20, "%.4s-%.2s-%.2s %.2s:%.2s:%.2s",
@@ -4616,11 +4616,11 @@ dissect_ber_UTCTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, t
if ((len < 10) || (len > 19)) {
error_str = wmem_strdup_printf(wmem_packet_scope(), "BER Error: UTCTime invalid length: %u", len);
- instr = tvb_get_ephemeral_string(tvb, offset, len > 19 ? 19 : len);
+ instr = tvb_get_string(wmem_packet_scope(), tvb, offset, len > 19 ? 19 : len);
goto malformed;
}
- instr = tvb_get_ephemeral_string(tvb, offset, len);
+ instr = tvb_get_string(wmem_packet_scope(), tvb, offset, len);
/* YYMMDDhhmm */
for (i=0; i<10; i++) {
@@ -4818,7 +4818,7 @@ dissect_ber_constrained_bitstring(gboolean implicit_tag, asn1_ctx_t *actx, proto
sep = " (";
term = FALSE;
nb = named_bits;
- bitstring = tvb_get_ephemeral_string(tvb, offset, len);
+ bitstring = tvb_get_string(wmem_packet_scope(), tvb, offset, len);
while (nb->p_id) {
if ((len > 0) && (nb->bit < (8*len-pad))) {
diff --git a/epan/dissectors/packet-bfd.c b/epan/dissectors/packet-bfd.c
index 9dda1b2ea0..1dabdc7a47 100644
--- a/epan/dissectors/packet-bfd.c
+++ b/epan/dissectors/packet-bfd.c
@@ -346,7 +346,7 @@ dissect_bfd_authentication(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch (auth_type) {
case BFD_AUTH_SIMPLE:
if (tree) {
- password = tvb_get_ephemeral_string(tvb, offset+3, auth_len-3);
+ password = tvb_get_string(wmem_packet_scope(), tvb, offset+3, auth_len-3);
proto_tree_add_string(auth_tree, hf_bfd_auth_password, tvb, offset+3,
auth_len-3, password);
proto_item_append_text(auth_item, ": %s", password);
diff --git a/epan/dissectors/packet-bittorrent.c b/epan/dissectors/packet-bittorrent.c
index 631cc4d111..04c3c4da7c 100644
--- a/epan/dissectors/packet-bittorrent.c
+++ b/epan/dissectors/packet-bittorrent.c
@@ -346,10 +346,10 @@ dissect_bencoding_str(tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree_add_item(tree, hf_bittorrent_bstr, tvb, offset+used, stringlen, ENC_ASCII|ENC_NA);
if (treeadd==1) {
- proto_item_append_text(ti, " Key: %s", format_text((guchar *)ep_tvb_memdup(tvb, offset+used, stringlen), stringlen));
+ proto_item_append_text(ti, " Key: %s", format_text((guchar *)tvb_memdup(wmem_packet_scope(), tvb, offset+used, stringlen), stringlen));
}
if (treeadd==2) {
- proto_item_append_text(ti, " Value: %s", format_text((guchar *)ep_tvb_memdup(tvb, offset+used, stringlen), stringlen));
+ proto_item_append_text(ti, " Value: %s", format_text((guchar *)tvb_memdup(wmem_packet_scope(), tvb, offset+used, stringlen), stringlen));
}
}
return used+stringlen;
@@ -780,8 +780,8 @@ dissect_bittorrent_welcome (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t
for(i = 0; peer_id[i].name != NULL; ++i)
{
if(tvb_memeql(tvb, offset, peer_id[i].id, (int)strlen(peer_id[i].id)) == 0) {
- version = tvb_get_ephemeral_string(tvb, offset + (int)strlen(peer_id[i].id),
- peer_id[i].ver_len);
+ version = tvb_get_string(wmem_packet_scope(), tvb, offset + (int)strlen(peer_id[i].id),
+ peer_id[i].ver_len);
proto_tree_add_text(tree, tvb, offset, 20, "Client is %s v%s",
peer_id[i].name,
format_text((guchar*)version, peer_id[i].ver_len));
diff --git a/epan/dissectors/packet-bmc.c b/epan/dissectors/packet-bmc.c
index 35164a406a..31c58f8a51 100644
--- a/epan/dissectors/packet-bmc.c
+++ b/epan/dissectors/packet-bmc.c
@@ -103,7 +103,7 @@ dissect_bmc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
/* Needs bit-reversing. Create a new buffer, copy the message to it and bit-reverse */
len = tvb_length(tvb);
- reversing_buffer = (guint8 *)tvb_g_memdup(tvb, offset, len);
+ reversing_buffer = (guint8 *)tvb_memdup(NULL, tvb, offset, len);
p_rev = reversing_buffer;
/* Entire message is bit reversed */
for (i=0; i<len; i++, p_rev++)
diff --git a/epan/dissectors/packet-bootp.c b/epan/dissectors/packet-bootp.c
index e22439c551..2dc51e1ba6 100644
--- a/epan/dissectors/packet-bootp.c
+++ b/epan/dissectors/packet-bootp.c
@@ -4327,7 +4327,7 @@ static void get_opt125_tlv(tvbuff_t *tvb, guint off, guint8 *tlvtype, guint8 *tl
/* Length */
*tlvlen = tvb_get_guint8(tvb, off+1);
/* Value */
- *value = (guint8 *)ep_tvb_memdup(tvb, off + 2, *tlvlen);
+ *value = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, off + 2, *tlvlen);
}
static void get_opt60_tlv(tvbuff_t *tvb, guint off, guint8 *tlvtype, guint8 *tlvlen, guint8 **value)
diff --git a/epan/dissectors/packet-bt-dht.c b/epan/dissectors/packet-bt-dht.c
index 9b4ee74acb..1f560097c8 100644
--- a/epan/dissectors/packet-bt-dht.c
+++ b/epan/dissectors/packet-bt-dht.c
@@ -104,7 +104,7 @@ bencoded_string_length(tvbuff_t *tvb, guint *offset_ptr)
while(tvb_get_guint8(tvb, offset) != ':')
++offset;
- len = atoi(tvb_get_ephemeral_string(tvb, start, offset-start));
+ len = atoi(tvb_get_string(wmem_packet_scope(), tvb, start, offset-start));
++offset; /* skip the ':' */
*offset_ptr = offset;
@@ -127,7 +127,7 @@ dissect_bencoded_string(tvbuff_t *tvb, packet_info _U_*pinfo, proto_tree *tree,
if( tohex )
*result = tvb_bytes_to_str(tvb, offset, string_len );
else
- *result = tvb_get_ephemeral_string( tvb, offset, string_len );
+ *result = tvb_get_string( wmem_packet_scope(), tvb, offset, string_len );
proto_tree_add_string_format( tree, hf_bencoded_string, tvb, offset, string_len, *result, "%s: %s", label, *result );
offset += string_len;
@@ -150,7 +150,7 @@ dissect_bencoded_int(tvbuff_t *tvb, packet_info _U_*pinfo, proto_tree *tree, gui
while( tvb_get_guint8(tvb,offset)!='e' )
offset += 1;
- *result = tvb_get_ephemeral_string( tvb, start_offset, offset-start_offset);
+ *result = tvb_get_string( wmem_packet_scope(), tvb, start_offset, offset-start_offset);
proto_tree_add_string_format( tree, hf_bencoded_int, tvb, start_offset, offset-start_offset, *result,
"%s: %s", label, *result );
diff --git a/epan/dissectors/packet-btavrcp.c b/epan/dissectors/packet-btavrcp.c
index 3e86f2f027..5a2d25a289 100644
--- a/epan/dissectors/packet-btavrcp.c
+++ b/epan/dissectors/packet-btavrcp.c
@@ -625,7 +625,7 @@ dissect_attribute_entries(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
for (i_entry = 0; i_entry < count; ++i_entry) {
attribute_id = tvb_get_ntohl(tvb, offset);
value_length = tvb_get_ntohs(tvb, offset + 4 + 2);
- value = tvb_get_g_string(tvb, offset + 4 + 2 + 2, value_length);
+ value = tvb_get_string(NULL, tvb, offset + 4 + 2 + 2, value_length);
if (attribute_id == 0x01) col_append_fstr(pinfo->cinfo, COL_INFO, " - Title: \"%s\"", value);
@@ -663,7 +663,7 @@ dissect_item_mediaplayer(tvbuff_t *tvb, proto_tree *tree, gint offset)
item_length = tvb_get_ntohs(tvb, offset + 1);
displayable_name_length = tvb_get_ntohs(tvb, offset + 1 + 2 + 1 + 1 + 4 + 16 + 1 + 2);
- displayable_name = tvb_get_g_string(tvb, offset + 1 + 2 + 1 + 1 + 4 + 16 + 1 + 2 + 2, displayable_name_length);
+ displayable_name = tvb_get_string(NULL, tvb, offset + 1 + 2 + 1 + 1 + 4 + 16 + 1 + 2 + 2, displayable_name_length);
pitem = proto_tree_add_text(tree, tvb, offset, 1 + 2 + item_length, "Player: %s", displayable_name);
ptree = proto_item_add_subtree(pitem, ett_btavrcp_player);
@@ -825,7 +825,7 @@ dissect_item_media_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
item_length = tvb_get_ntohs(tvb, offset + 1);
displayable_name_length = tvb_get_ntohs(tvb, offset + 1 + 2 + 8 + 1 + 2);
- displayable_name = tvb_get_g_string(tvb, offset + 1 + 2 + 8 + 1 + 2 + 2, displayable_name_length);
+ displayable_name = tvb_get_string(NULL, tvb, offset + 1 + 2 + 8 + 1 + 2 + 2, displayable_name_length);
pitem = proto_tree_add_text(tree, tvb, offset, 1 + 2 + item_length, "Element: %s", displayable_name);
ptree = proto_item_add_subtree(pitem, ett_btavrcp_element);
@@ -877,7 +877,7 @@ dissect_item_folder(tvbuff_t *tvb, proto_tree *tree, gint offset)
item_length = tvb_get_ntohs(tvb, offset + 1);
displayable_name_length = tvb_get_ntohs(tvb, offset + 1 + 2 + 8 + 1 + 1 + 2);
- displayable_name = tvb_get_g_string(tvb, offset + 1 + 2 + 8 + 1 + 1 + 2 + 2, displayable_name_length);
+ displayable_name = tvb_get_string(NULL, tvb, offset + 1 + 2 + 8 + 1 + 1 + 2 + 2, displayable_name_length);
pitem = proto_tree_add_text(tree, tvb, offset, 1 + 2 + item_length, "Folder : %s", displayable_name);
ptree = proto_item_add_subtree(pitem, ett_btavrcp_folder);
@@ -1903,7 +1903,7 @@ dissect_browsing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
folder_name_length = tvb_get_ntohs(tvb, offset);
offset += 2;
proto_tree_add_item(ptree, hf_btavrcp_folder_name, tvb, offset, folder_name_length, ENC_NA);
- folder_name = tvb_get_g_string(tvb, offset, folder_name_length);
+ folder_name = tvb_get_string(NULL, tvb, offset, folder_name_length);
offset += folder_name_length;
proto_item_append_text(pitem, "%s/", folder_name);
col_append_fstr(pinfo->cinfo, COL_INFO, "%s/", folder_name);
diff --git a/epan/dissectors/packet-bthci_evt.c b/epan/dissectors/packet-bthci_evt.c
index 7254cb951b..be6f3ee894 100644
--- a/epan/dissectors/packet-bthci_evt.c
+++ b/epan/dissectors/packet-bthci_evt.c
@@ -1383,7 +1383,7 @@ dissect_bthci_evt_remote_name_req_complete(tvbuff_t *tvb, int offset, packet_inf
gchar *name;
device_name_t *device_name;
- name = tvb_get_ephemeral_string(tvb, offset, 248);
+ name = tvb_get_string(wmem_packet_scope(), tvb, offset, 248);
k_frame_number = pinfo->fd->num;
k_bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
@@ -1841,7 +1841,7 @@ dissect_bthci_evt_eir_ad_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
gchar *name;
device_name_t *device_name;
- name = tvb_get_ephemeral_string(tvb, offset+i+2, length-1);
+ name = tvb_get_string(wmem_packet_scope(), tvb, offset+i+2, length-1);
k_frame_number = pinfo->fd->num;
k_bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
@@ -2706,7 +2706,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, packet_info *pinfo
k_adapter_id = hci_data->adapter_id;
k_frame_number = pinfo->fd->num;
- name = tvb_get_ephemeral_string(tvb, offset, 248);
+ name = tvb_get_string(wmem_packet_scope(), tvb, offset, 248);
key[0].length = 1;
key[0].key = &k_interface_id;
diff --git a/epan/dissectors/packet-bthcrp.c b/epan/dissectors/packet-bthcrp.c
index f3085c7645..45c64cc90f 100644
--- a/epan/dissectors/packet-bthcrp.c
+++ b/epan/dissectors/packet-bthcrp.c
@@ -237,7 +237,7 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 *id;
proto_tree_add_item(tree, hf_bthcrp_control_1284_id, tvb, offset, -1, ENC_ASCII | ENC_NA);
- id = tvb_get_g_string(tvb, offset, tvb_length_remaining(tvb, offset));
+ id = tvb_get_string(NULL, tvb, offset, tvb_length_remaining(tvb, offset));
col_append_fstr(pinfo->cinfo, COL_INFO, " - 1284 ID: %s", id);
offset += tvb_length_remaining(tvb, offset);
}
diff --git a/epan/dissectors/packet-bthfp.c b/epan/dissectors/packet-bthfp.c
index b7a105a25f..b98f74ede3 100644
--- a/epan/dissectors/packet-bthfp.c
+++ b/epan/dissectors/packet-bthfp.c
@@ -1343,7 +1343,7 @@ dissect_bthfp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Detect reassemble end character: \r for HS or \n for AG */
length = tvb_length(tvb);
- at_stream = tvb_get_ephemeral_string(tvb, 0, length);
+ at_stream = tvb_get_string(wmem_packet_scope(), tvb, 0, length);
reassemble_start_offset = 0;
diff --git a/epan/dissectors/packet-btobex.c b/epan/dissectors/packet-btobex.c
index aeebc72200..14fb2ab20b 100644
--- a/epan/dissectors/packet-btobex.c
+++ b/epan/dissectors/packet-btobex.c
@@ -1222,8 +1222,8 @@ dissect_headers(proto_tree *tree, tvbuff_t *tvb, int offset, packet_info *pinfo,
}
else if (is_ascii_str(tvb_get_ptr(tvb, offset,item_length - 3), item_length - 3))
{
- proto_item_append_text(hdr_tree, " (\"%s\")", tvb_get_ephemeral_string(tvb, offset,item_length - 3));
- col_append_fstr(pinfo->cinfo, COL_INFO, " \"%s\"", tvb_get_ephemeral_string(tvb, offset,item_length - 3));
+ proto_item_append_text(hdr_tree, " (\"%s\")", tvb_get_string(wmem_packet_scope(), tvb, offset,item_length - 3));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " \"%s\"", tvb_get_string(wmem_packet_scope(), tvb, offset,item_length - 3));
}
if (item_length >= 3) /* prevent infinite loops */
diff --git a/epan/dissectors/packet-btsdp.c b/epan/dissectors/packet-btsdp.c
index eacec6c77c..279f05d77a 100644
--- a/epan/dissectors/packet-btsdp.c
+++ b/epan/dissectors/packet-btsdp.c
@@ -2126,22 +2126,22 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
switch (attribute) {
case 0x300:
proto_tree_add_item(next_tree, hf_hcrp_1284_id, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x302:
proto_tree_add_item(next_tree, hf_hcrp_device_name, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x304:
proto_tree_add_item(next_tree, hf_hcrp_friendly_name, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x306:
proto_tree_add_item(next_tree, hf_hcrp_device_location, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
default:
@@ -2163,7 +2163,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
break;
case 0x308:
proto_tree_add_item(next_tree, hf_wap_homepage_url, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x309:
@@ -2235,7 +2235,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
proto_item_set_len(entry_item, (new_offset - entry_offset) + length);
entry_offset = new_offset;
proto_tree_add_item(next_tree, hf_hdp_supported_features_mdep_description, tvb, entry_offset, length, ENC_ASCII | ENC_NA);
- proto_item_append_text(entry_item, ": %s", tvb_get_ephemeral_string(tvb, entry_offset, length));
+ proto_item_append_text(entry_item, ": %s", tvb_get_string(wmem_packet_scope(), tvb, entry_offset, length));
entry_offset += length;
}
@@ -2277,12 +2277,12 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
case 0x30D:
case 0x200:
proto_tree_add_item(next_tree, hf_pan_ipv4_subnet, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x30E:
proto_tree_add_item(next_tree, hf_pan_ipv6_subnet, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
default:
@@ -2309,12 +2309,12 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
case 0x30D:
case 0x200:
proto_tree_add_item(next_tree, hf_pan_ipv4_subnet, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x30E:
proto_tree_add_item(next_tree, hf_pan_ipv6_subnet, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
default:
@@ -2366,7 +2366,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
break;
case 0x306:
proto_tree_add_item(next_tree, hf_dun_escape_sequence, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
default:
@@ -2735,7 +2735,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
switch (attribute) {
case 0x350:
proto_tree_add_item(next_tree, hf_bpp_document_formats_supported, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x352:
@@ -2745,7 +2745,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
break;
case 0x354:
proto_tree_add_item(next_tree, hf_bpp_xhtml_print_image_formats_supported, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x356:
@@ -2755,17 +2755,17 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
break;
case 0x358:
proto_tree_add_item(next_tree, hf_bpp_1284_id, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x35A:
proto_tree_add_item(next_tree, hf_bpp_printer_name, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x35C:
proto_tree_add_item(next_tree, hf_bpp_printer_location, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x35E:
@@ -2775,7 +2775,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
break;
case 0x360:
proto_tree_add_item(next_tree, hf_bpp_media_types_supported, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x362:
@@ -2795,7 +2795,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
break;
case 0x368:
proto_tree_add_item(next_tree, hf_bpp_rui_formats_supported, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x370:
@@ -2810,17 +2810,17 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
break;
case 0x374:
proto_tree_add_item(next_tree, hf_bpp_reference_printing_top_url, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x376:
proto_tree_add_item(next_tree, hf_bpp_direct_printing_top_url, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x37A:
proto_tree_add_item(next_tree, hf_bpp_device_name, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
default:
@@ -2831,12 +2831,12 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
switch (attribute) {
case 0x368:
proto_tree_add_item(next_tree, hf_bpp_rui_formats_supported, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x378:
proto_tree_add_item(next_tree, hf_bpp_printer_admin_rui_top_url, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
default:
@@ -2927,7 +2927,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, list_offset);
list_offset = get_type_length(tvb, list_offset, &entry_length);
- new_str = tvb_get_ephemeral_string(tvb, list_offset, entry_length);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, list_offset, entry_length);
strpos += g_snprintf(str + strpos, MAX_SDP_LEN - strpos, "Lang: %s", new_str);
proto_item_append_text(entry_item, ": Lang: %s", new_str);
proto_tree_add_item(sub_tree, hf_sdp_lang_code, tvb, list_offset, entry_length, ENC_ASCII | ENC_NA);
@@ -3010,17 +3010,17 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
break;
case 0x00A:
proto_tree_add_item(next_tree, hf_sdp_service_documentation_url, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x00B:
proto_tree_add_item(next_tree, hf_sdp_service_client_executable_url, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x00C:
proto_tree_add_item(next_tree, hf_sdp_service_icon_url, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x00D:
@@ -3048,17 +3048,17 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
break;
case 0x100:
proto_tree_add_item(next_tree, hf_sdp_service_name, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x101:
proto_tree_add_item(next_tree, hf_sdp_service_description, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
case 0x102:
proto_tree_add_item(next_tree, hf_sdp_service_provider_name, tvb, offset, size, ENC_ASCII | ENC_NA);
- new_str = tvb_get_ephemeral_string(tvb, offset, size);
+ new_str = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
g_snprintf(str, MAX_SDP_LEN, "%s", new_str);
break;
default:
@@ -3112,7 +3112,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
}
case 8: /* fall through */
case 4: {
- gchar *ptr = (gchar*)tvb_get_ephemeral_string(tvb, offset, size);
+ gchar *ptr = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, offset, size);
proto_tree_add_text(next_tree, tvb, offset, size, "%s \"%s\"",
type == 8 ? "URL" : "String", ptr);
diff --git a/epan/dissectors/packet-c1222.c b/epan/dissectors/packet-c1222.c
index ebc9041b43..961818bcff 100644
--- a/epan/dissectors/packet-c1222.c
+++ b/epan/dissectors/packet-c1222.c
@@ -349,11 +349,11 @@ static uat_t *c1222_uat;
#define FILL_START int length, start_offset = offset;
#define FILL_TABLE(fieldname) \
length = offset - start_offset; \
- fieldname = (guint8 *)tvb_g_memdup(tvb, start_offset, length); \
+ fieldname = (guint8 *)tvb_memdup(NULL, tvb, start_offset, length); \
fieldname##_len = length;
#define FILL_TABLE_TRUNCATE(fieldname, len) \
length = 1 + 2*(offset - start_offset); \
- fieldname = (guint8 *)tvb_g_memdup(tvb, start_offset, length); \
+ fieldname = (guint8 *)tvb_memdup(NULL, tvb, start_offset, length); \
fieldname##_len = len;
#else /* HAVE_LIBGCRYPT */
#define FILL_TABLE(fieldname)
@@ -436,7 +436,7 @@ parse_c1222_detailed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int cm
user_id = tvb_get_ntohs(tvb, *offset);
proto_tree_add_uint(tree, hf_c1222_logon_id, tvb, *offset, 2, user_id);
*offset += 2;
- user_name = tvb_get_ephemeral_string(tvb, *offset, 10);
+ user_name = tvb_get_string(wmem_packet_scope(),tvb, *offset, 10);
proto_tree_add_string(tree, hf_c1222_logon_user, tvb, *offset, 10, user_name);
*offset += 10;
*length -= 12;
@@ -448,7 +448,7 @@ parse_c1222_detailed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int cm
break;
case C1222_CMD_SECURITY:
if (*length >= 20) {
- password = tvb_get_ephemeral_string(tvb, *offset, 20);
+ password = tvb_get_string(wmem_packet_scope(),tvb, *offset, 20);
proto_tree_add_string(tree, hf_c1222_security_password, tvb, *offset, 20, password);
*offset += 20;
*length -= 20;
@@ -967,7 +967,7 @@ dissect_epsem(tvbuff_t *tvb, int offset, guint32 len, packet_info *pinfo, proto_
return offset;
encrypted = TRUE;
if (c1222_decrypt) {
- buffer = (guchar *)tvb_g_memdup(tvb, offset, len2);
+ buffer = (guchar *)tvb_memdup(NULL, tvb, offset, len2);
if (!decrypt_packet(buffer, len2, TRUE)) {
g_free(buffer);
crypto_bad = TRUE;
@@ -986,7 +986,7 @@ dissect_epsem(tvbuff_t *tvb, int offset, guint32 len, packet_info *pinfo, proto_
len2 = tvb_length_remaining(tvb, offset);
if (len2 <= 0)
return offset;
- buffer = (guchar *)tvb_g_memdup(tvb, offset, len2);
+ buffer = (guchar *)tvb_memdup(NULL, tvb, offset, len2);
epsem_buffer = tvb_new_subset_remaining(tvb, offset);
if (c1222_decrypt) {
if (!decrypt_packet(buffer, len2, FALSE)) {
diff --git a/epan/dissectors/packet-catapult-dct2000.c b/epan/dissectors/packet-catapult-dct2000.c
index 18937c9a36..362b0009c7 100644
--- a/epan/dissectors/packet-catapult-dct2000.c
+++ b/epan/dissectors/packet-catapult-dct2000.c
@@ -1920,7 +1920,7 @@ static void dissect_tty_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
int linelen = tvb_find_line_end_unquoted(tvb, offset, -1, &next_offset);
/* Extract & add the string. */
- char *string = (char*)tvb_get_ephemeral_string(tvb, offset, linelen);
+ char *string = (char*)tvb_get_string(wmem_packet_scope(), tvb, offset, linelen);
if (isascii(string[0])) {
/* If looks printable treat as string... */
proto_tree_add_string_format(tty_tree, hf_catapult_dct2000_tty_line,
@@ -2465,7 +2465,7 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (strcmp(protocol_name, "comment") == 0) {
/* Extract & add the string. */
proto_item *string_ti;
- char *string = (char*)tvb_get_ephemeral_string(tvb, offset, tvb_length_remaining(tvb, offset));
+ char *string = (char*)tvb_get_string(wmem_packet_scope(), tvb, offset, tvb_length_remaining(tvb, offset));
/* Show comment string */
string_ti = proto_tree_add_item(dct2000_tree, hf_catapult_dct2000_comment, tvb,
@@ -2492,7 +2492,7 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
if (strcmp(protocol_name, "sprint") == 0) {
/* Extract & add the string. */
- char *string = (char*)tvb_get_ephemeral_string(tvb, offset, tvb_length_remaining(tvb, offset));
+ char *string = (char*)tvb_get_string(wmem_packet_scope(), tvb, offset, tvb_length_remaining(tvb, offset));
/* Show sprint string */
proto_tree_add_item(dct2000_tree, hf_catapult_dct2000_sprint, tvb,
diff --git a/epan/dissectors/packet-cell_broadcast.c b/epan/dissectors/packet-cell_broadcast.c
index 087575ba1c..849525022a 100644
--- a/epan/dissectors/packet-cell_broadcast.c
+++ b/epan/dissectors/packet-cell_broadcast.c
@@ -256,7 +256,7 @@ tvbuff_t * dissect_cbs_data(guint8 sms_encoding, tvbuff_t *tvb, proto_tree *tree
int length = tvb_length(tvb) - offset;
gchar *utf8_text = NULL, *utf8_out;
static unsigned char msgbuf[1024];
- guint8 * input_string = tvb_get_ephemeral_string(tvb, offset, length);
+ guint8 * input_string = tvb_get_string(wmem_packet_scope(), tvb, offset, length);
GIConv cd;
GError *l_conv_error = NULL;
@@ -352,12 +352,12 @@ dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *cbs_page_subtree = proto_item_add_subtree(item, ett_gsm_cbs_page_content);
len = tvb_length(cbs_page_tvb);
proto_tree_add_string(cbs_page_subtree, hf_gsm_cbs_page_content, cbs_page_tvb, 0,
- text_len, tvb_get_ephemeral_string(cbs_page_tvb, 0, text_len));
+ text_len, tvb_get_string(wmem_packet_scope(), cbs_page_tvb, 0, text_len));
len -= text_len;
if (len)
{
proto_tree_add_string(cbs_page_subtree, hf_gsm_cbs_page_content_padding, cbs_page_tvb, text_len, len,
- tvb_get_ephemeral_string(cbs_page_tvb, text_len, len));
+ tvb_get_string(wmem_packet_scope(), cbs_page_tvb, text_len, len));
}
}
if (text_len)
@@ -393,7 +393,7 @@ dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
cbs_msg_item = proto_tree_add_protocol_format(proto_tree_get_root(tree), proto_cell_broadcast, cbs_msg_tvb, 0, len, "GSM Cell Broadcast Message");
cbs_msg_tree = proto_item_add_subtree(cbs_msg_item, ett_cbs_msg);
- proto_tree_add_string(cbs_msg_tree, hf_gsm_cbs_message_content, cbs_msg_tvb, 0, len, tvb_get_ephemeral_string(cbs_msg_tvb, 0, len));
+ proto_tree_add_string(cbs_msg_tree, hf_gsm_cbs_message_content, cbs_msg_tvb, 0, len, tvb_get_string(wmem_packet_scope(), cbs_msg_tvb, 0, len));
}
}
@@ -422,7 +422,7 @@ void dissect_umts_cell_broadcast_message(tvbuff_t *tvb, packet_info *pinfo, prot
msg_len = tvb_length(cbs_msg_tvb);
cbs_item2 = proto_tree_add_text(cbs_tree, tvb, offset, -1, "Cell Broadcast Message Contents (length: %d)", msg_len);
cbs_subtree = proto_item_add_subtree(cbs_item2, ett_cbs_msg);
- proto_tree_add_text(cbs_subtree, cbs_msg_tvb , 0, tvb_length(cbs_msg_tvb), "%s", tvb_get_ephemeral_string(cbs_msg_tvb, 0, msg_len));
+ proto_tree_add_text(cbs_subtree, cbs_msg_tvb , 0, tvb_length(cbs_msg_tvb), "%s", tvb_get_string(wmem_packet_scope(), cbs_msg_tvb, 0, msg_len));
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-cip.c b/epan/dissectors/packet-cip.c
index 15fca4a561..8319ba6537 100644
--- a/epan/dissectors/packet-cip.c
+++ b/epan/dissectors/packet-cip.c
@@ -5806,7 +5806,7 @@ dissect_cip_cco_all_attribute_common( proto_tree *cmd_tree, tvbuff_t *tvb, int o
/* Connection Name */
connection_name_size = tvb_get_guint8( tvb, offset+variable_data_size);
- str_connection_name = tvb_get_ephemeral_string(tvb, offset+variable_data_size+2, connection_name_size);
+ str_connection_name = tvb_get_string(wmem_packet_scope(), tvb, offset+variable_data_size+2, connection_name_size);
proto_tree_add_text(cmd_tree, tvb, offset+variable_data_size, connection_name_size+2, "Connection Name: %s", str_connection_name);
variable_data_size += ((connection_name_size*2)+2);
diff --git a/epan/dissectors/packet-cmpp.c b/epan/dissectors/packet-cmpp.c
index 99ebca7c68..56cc0af445 100644
--- a/epan/dissectors/packet-cmpp.c
+++ b/epan/dissectors/packet-cmpp.c
@@ -258,7 +258,7 @@ cmpp_octet_string(proto_tree *tree, tvbuff_t *tvb, gint field, gint offset, gint
{
char *display;
- display = (char *)tvb_get_ephemeral_string(tvb, offset, length);
+ display = (char *)tvb_get_string(wmem_packet_scope(), tvb, offset, length);
proto_tree_add_string(tree, field, tvb, offset, length, display);
return display;
}
diff --git a/epan/dissectors/packet-coap.c b/epan/dissectors/packet-coap.c
index 13299463ba..70ff7da7d5 100644
--- a/epan/dissectors/packet-coap.c
+++ b/epan/dissectors/packet-coap.c
@@ -333,7 +333,7 @@ dissect_coap_opt_uri_host(tvbuff_t *tvb, proto_item *head_item, proto_tree *subt
{
guint8 *str = NULL;
- str = tvb_get_ephemeral_string(tvb, offset, opt_length);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset, opt_length);
proto_tree_add_string(subtree, hf_coap_opt_uri_host, tvb, offset, opt_length, str);
@@ -364,7 +364,7 @@ dissect_coap_opt_uri_path(tvbuff_t *tvb, proto_item *head_item, proto_tree *subt
if (opt_length == 0) {
str = nullstr;
} else {
- str = tvb_get_ephemeral_string(tvb, offset, opt_length);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset, opt_length);
g_strlcat(coap_uri_str, str, sizeof(coap_uri_str));
}
@@ -387,7 +387,7 @@ dissect_coap_opt_uri_query(tvbuff_t *tvb, proto_item *head_item,proto_tree *subt
if (opt_length == 0) {
str = nullstr;
} else {
- str = tvb_get_ephemeral_string(tvb, offset, opt_length);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset, opt_length);
g_strlcat(coap_uri_str, str, sizeof(coap_uri_str));
}
@@ -405,7 +405,7 @@ dissect_coap_opt_location_path(tvbuff_t *tvb, proto_item *head_item, proto_tree
if (opt_length == 0) {
str = nullstr;
} else {
- str = tvb_get_ephemeral_string(tvb, offset, opt_length);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset, opt_length);
}
proto_tree_add_string(subtree, hf_coap_opt_location_path, tvb, offset, opt_length, str);
@@ -422,7 +422,7 @@ dissect_coap_opt_location_query(tvbuff_t *tvb, proto_item *head_item, proto_tree
if (opt_length == 0) {
str = nullstr;
} else {
- str = tvb_get_ephemeral_string(tvb, offset, opt_length);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset, opt_length);
}
proto_tree_add_string(subtree, hf_coap_opt_location_query, tvb, offset, opt_length, str);
@@ -439,7 +439,7 @@ dissect_coap_opt_proxy_uri(tvbuff_t *tvb, proto_item *head_item, proto_tree *sub
if (opt_length == 0) {
str = nullstr;
} else {
- str = tvb_get_ephemeral_string(tvb, offset, opt_length);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset, opt_length);
}
proto_tree_add_string(subtree, hf_coap_opt_proxy_uri, tvb, offset, opt_length, str);
diff --git a/epan/dissectors/packet-collectd.c b/epan/dissectors/packet-collectd.c
index ee3b19d4c0..f67ee9fa6a 100644
--- a/epan/dissectors/packet-collectd.c
+++ b/epan/dissectors/packet-collectd.c
@@ -396,7 +396,7 @@ dissect_collectd_string (tvbuff_t *tvb, packet_info *pinfo, gint type_hf,
*ret_offset = offset + 4;
*ret_length = length - 4;
- *ret_string = tvb_get_ephemeral_string (tvb, *ret_offset, *ret_length);
+ *ret_string = tvb_get_string (wmem_packet_scope(), tvb, *ret_offset, *ret_length);
pi = proto_tree_add_text (tree_root, tvb, offset, length,
"collectd %s segment: \"%s\"",
@@ -1008,7 +1008,7 @@ dissect_collectd (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch (part_type) {
case TYPE_HOST:
- vdispatch.host = tvb_get_ephemeral_string (tvb,
+ vdispatch.host = tvb_get_string (wmem_packet_scope(), tvb,
offset + 4, part_length - 4);
if (pkt_host == NULL)
pkt_host = vdispatch.host;
@@ -1017,14 +1017,14 @@ dissect_collectd (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case TYPE_TIME_HR:
break;
case TYPE_PLUGIN:
- vdispatch.plugin = tvb_get_ephemeral_string (tvb,
+ vdispatch.plugin = tvb_get_string (wmem_packet_scope(), tvb,
offset + 4, part_length - 4);
pkt_plugins++;
break;
case TYPE_PLUGIN_INSTANCE:
break;
case TYPE_TYPE:
- vdispatch.type = tvb_get_ephemeral_string (tvb,
+ vdispatch.type = tvb_get_string (wmem_packet_scope(), tvb,
offset + 4, part_length - 4);
break;
case TYPE_TYPE_INSTANCE:
diff --git a/epan/dissectors/packet-cops.c b/epan/dissectors/packet-cops.c
index 2a1e10e0f4..bcaaff2556 100644
--- a/epan/dissectors/packet-cops.c
+++ b/epan/dissectors/packet-cops.c
@@ -1599,7 +1599,7 @@ static int dissect_cops_pr_object_data(tvbuff_t *tvb, packet_info *pinfo, guint3
encoid_len = tvb_length_remaining(oid_tvb,0);
if (encoid_len > 0) {
- encoid = (guint8*)ep_tvb_memdup(oid_tvb,0,encoid_len);
+ encoid = (guint8*)tvb_memdup(wmem_packet_scope(),oid_tvb,0,encoid_len);
(*pprid_subids_len) = oid_encoded2subid(encoid, encoid_len, pprid_subids);
}
}
@@ -1627,7 +1627,7 @@ static int dissect_cops_pr_object_data(tvbuff_t *tvb, packet_info *pinfo, guint3
/* TODO: check pc, class and tag */
- encoid = (guint8*)ep_tvb_memdup(tvb,offset,encoid_len);
+ encoid = (guint8*)tvb_memdup(wmem_packet_scope(),tvb,offset,encoid_len);
if (*pprid_subids) {
/* Never tested this branch */
@@ -2858,7 +2858,7 @@ info_to_display(tvbuff_t *tvb, proto_item *stt, int offset, int octets, const ch
/* Special section for printing strings */
if (mode==FMT_STR) {
- codestr = tvb_get_ephemeral_string(tvb, offset, octets);
+ codestr = tvb_get_string(wmem_packet_scope(), tvb, offset, octets);
pi = proto_tree_add_string_format(stt, *hf_proto_parameter, tvb,
offset, octets, codestr, "%-28s : %s", str, codestr);
return pi;
diff --git a/epan/dissectors/packet-data.c b/epan/dissectors/packet-data.c
index 9a866619b0..13c5950a98 100644
--- a/epan/dissectors/packet-data.c
+++ b/epan/dissectors/packet-data.c
@@ -74,7 +74,7 @@ dissect_data(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
proto_item *ti;
proto_tree *data_tree;
if (new_pane) {
- guint8 *real_data = (guint8 *)tvb_g_memdup(tvb, 0, bytes);
+ guint8 *real_data = (guint8 *)tvb_memdup(NULL, tvb, 0, bytes);
data_tvb = tvb_new_child_real_data(tvb,real_data,bytes,bytes);
tvb_set_free_cb(data_tvb, g_free);
add_new_data_source(pinfo, data_tvb, "Not dissected data bytes");
diff --git a/epan/dissectors/packet-dbus.c b/epan/dissectors/packet-dbus.c
index ae268e0add..cfc3b0e3b6 100644
--- a/epan/dissectors/packet-dbus.c
+++ b/epan/dissectors/packet-dbus.c
@@ -311,7 +311,7 @@ dissect_dbus_sig(tvbuff_t *tvb, dbus_info_t *dinfo, proto_tree *tree, int offset
len = dinfo->get32(tvb, offset);
offset += 4;
- val = tvb_get_ephemeral_string(tvb, offset, len);
+ val = tvb_get_string(wmem_packet_scope(), tvb, offset, len);
offset += (len + 1 /* NUL-byte */ + 3) & ~3;
if (sig == 's') {
@@ -339,7 +339,7 @@ dissect_dbus_sig(tvbuff_t *tvb, dbus_info_t *dinfo, proto_tree *tree, int offset
len = tvb_get_guint8(tvb, offset);
offset += 1;
- val = tvb_get_ephemeral_string(tvb, offset, len);
+ val = tvb_get_string(wmem_packet_scope(), tvb, offset, len);
offset += (len + 1);
ti = proto_tree_add_string_format(tree, hfi_dbus_value_str.id, tvb, org_offset, offset - org_offset, val, "SIGNATURE: %s", val);
@@ -370,7 +370,7 @@ dissect_dbus_field_signature(tvbuff_t *tvb, dbus_info_t *dinfo, proto_tree *tree
/* sig_len = tvb_strsize(tvb, offset); */
- sig = tvb_get_ephemeral_string(tvb, offset, sig_len);
+ sig = tvb_get_string(wmem_packet_scope(), tvb, offset, sig_len);
offset += (sig_len + 1);
ti = proto_tree_add_string(tree, &hfi_dbus_type_signature, tvb, org_offset, offset - org_offset, sig);
diff --git a/epan/dissectors/packet-dcerpc-epm.c b/epan/dissectors/packet-dcerpc-epm.c
index 26e1810cb3..e5b5a7642b 100644
--- a/epan/dissectors/packet-dcerpc-epm.c
+++ b/epan/dissectors/packet-dcerpc-epm.c
@@ -187,7 +187,7 @@ epm_dissect_ept_entry_t(tvbuff_t *tvb, int offset,
hf_epm_ann_offset, NULL);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
hf_epm_ann_len, &len);
- str=tvb_get_ephemeral_string(tvb, offset, len);
+ str=tvb_get_string(wmem_packet_scope(), tvb, offset, len);
proto_tree_add_item(tree, hf_epm_annotation, tvb, offset, len, ENC_ASCII|ENC_NA);
offset += len;
@@ -440,17 +440,17 @@ epm_dissect_tower_data (tvbuff_t *tvb, int offset,
case PROTO_ID_NAMED_PIPES: /* \\PIPE\xxx named pipe */
proto_tree_add_item(tr, hf_epm_proto_named_pipes, tvb, offset, len, ENC_ASCII|ENC_NA);
- proto_item_append_text(tr, "NamedPipe:%s", tvb_get_ephemeral_string(tvb, offset, len));
+ proto_item_append_text(tr, "NamedPipe:%s", tvb_get_string(wmem_packet_scope(), tvb, offset, len));
break;
case PROTO_ID_NAMED_PIPES_2: /* PIPENAME named pipe */
proto_tree_add_item(tr, hf_epm_proto_named_pipes, tvb, offset, len, ENC_ASCII|ENC_NA);
- proto_item_append_text(tr, "PIPE:%s", tvb_get_ephemeral_string(tvb, offset, len));
+ proto_item_append_text(tr, "PIPE:%s", tvb_get_string(wmem_packet_scope(), tvb, offset, len));
break;
case PROTO_ID_NETBIOS: /* \\NETBIOS netbios name */
proto_tree_add_item(tr, hf_epm_proto_netbios_name, tvb, offset, len, ENC_ASCII|ENC_NA);
- proto_item_append_text(tr, "NetBIOS:%s", tvb_get_ephemeral_string(tvb, offset, len));
+ proto_item_append_text(tr, "NetBIOS:%s", tvb_get_string(wmem_packet_scope(), tvb, offset, len));
break;
case PROTO_ID_HTTP: /* RPC over HTTP */
proto_tree_add_item(tr, hf_epm_proto_http_port, tvb, offset, 2, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-dcerpc-eventlog.c b/epan/dissectors/packet-dcerpc-eventlog.c
index 01d0faa8d2..55b906e444 100644
--- a/epan/dissectors/packet-dcerpc-eventlog.c
+++ b/epan/dissectors/packet-dcerpc-eventlog.c
@@ -368,7 +368,7 @@ eventlog_dissect_element_Record_source_name(tvbuff_t *tvb, int offset, packet_in
char *str;
int len;
len=eventlog_get_unicode_string_length(tvb, offset);
- str=tvb_get_ephemeral_faked_unicode(tvb, offset, len, TRUE);
+ str=tvb_get_faked_unicode(wmem_packet_scope(), tvb, offset, len, TRUE);
proto_tree_add_string_format(tree, hf_eventlog_Record_source_name, tvb, offset, len*2, str, "source_name: %s", str);
offset+=len*2;
return offset;
@@ -379,7 +379,7 @@ eventlog_dissect_element_Record_computer_name(tvbuff_t *tvb, int offset, packet_
char *str;
int len;
len=eventlog_get_unicode_string_length(tvb, offset);
- str=tvb_get_ephemeral_faked_unicode(tvb, offset, len, TRUE);
+ str=tvb_get_faked_unicode(wmem_packet_scope(), tvb, offset, len, TRUE);
proto_tree_add_string_format(tree, hf_eventlog_Record_computer_name, tvb, offset, len*2, str, "computer_name: %s", str);
offset+=len*2;
return offset;
@@ -407,7 +407,7 @@ eventlog_dissect_element_Record_strings(tvbuff_t *tvb, int offset, packet_info *
char *str;
int len;
len=eventlog_get_unicode_string_length(tvb, string_offset);
- str=tvb_get_ephemeral_faked_unicode(tvb, string_offset, len, TRUE);
+ str=tvb_get_faked_unicode(wmem_packet_scope(), tvb, string_offset, len, TRUE);
proto_tree_add_string_format(tree, hf_eventlog_Record_string, tvb, string_offset, len*2, str, "string: %s", str);
string_offset+=len*2;
diff --git a/epan/dissectors/packet-dcerpc-fileexp.c b/epan/dissectors/packet-dcerpc-fileexp.c
index cfeb1caa8c..756e6c2584 100644
--- a/epan/dissectors/packet-dcerpc-fileexp.c
+++ b/epan/dissectors/packet-dcerpc-fileexp.c
@@ -589,7 +589,7 @@ typedef [string] byte NameString_t[AFS_NAMEMAX];
if (string_size < AFS_NAMEMAX)
{
proto_tree_add_item (tree, hf_fileexp_afsNameString_t_principalName_string, tvb, offset, string_size, ENC_ASCII|ENC_NA);
- namestring = tvb_get_ephemeral_string (tvb, offset, string_size);
+ namestring = tvb_get_string (wmem_packet_scope(), tvb, offset, string_size);
offset += string_size;
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s", namestring);
@@ -778,7 +778,7 @@ dissect_afsTaggedPath (tvbuff_t * tvb, int offset,
hf_fileexp_afsTaggedPath_tp_length, &tp_length);
proto_tree_add_item (tree, hf_fileexp_afsTaggedPath_tp_chars, tvb, offset,
tp_length, ENC_ASCII|ENC_NA);
- tp_chars = tvb_get_ephemeral_string (tvb, offset, 1025);
+ tp_chars = tvb_get_string (wmem_packet_scope(), tvb, offset, 1025);
offset += 1025;
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, " :tp_chars %s", tp_chars);
@@ -1358,7 +1358,7 @@ dissect_afstaggedname (tvbuff_t * tvb, int offset,
{
proto_tree_add_item (tree, hf_fileexp_tn_string, tvb, offset,
tn_length, ENC_ASCII|ENC_NA);
- tn_string = tvb_get_ephemeral_string (tvb, offset, 257);
+ tn_string = tvb_get_string (wmem_packet_scope(), tvb, offset, 257);
offset += 257;
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, " :tn_tag: %s", tn_string);
diff --git a/epan/dissectors/packet-dcerpc-fldb.c b/epan/dissectors/packet-dcerpc-fldb.c
index 95239170a3..20ab95a119 100644
--- a/epan/dissectors/packet-dcerpc-fldb.c
+++ b/epan/dissectors/packet-dcerpc-fldb.c
@@ -349,7 +349,7 @@ dissect_vlconf_cell (tvbuff_t * tvb, int offset,
/* byte name[MAXVLCELLCHARS]; Cell name */
proto_tree_add_item (tree, hf_fldb_vlconf_cell_name, tvb, offset, 114, ENC_ASCII|ENC_NA);
- name = tvb_get_ephemeral_string (tvb, offset, MAXVLCELLCHARS); /* XXX why 114 above and 128 here?? */
+ name = tvb_get_string (wmem_packet_scope(), tvb, offset, MAXVLCELLCHARS); /* XXX why 114 above and 128 here?? */
offset += MAXVLCELLCHARS; /* some reason this 114 seems to be incorrect... cutting 4 short to compensate.... */
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, " Name: %s", name);
@@ -388,7 +388,7 @@ dissect_vlconf_cell (tvbuff_t * tvb, int offset,
{
proto_tree_add_item (tree, hf_fldb_vlconf_cell_hostname, tvb, offset,
64, ENC_ASCII|ENC_NA);
- hostname = tvb_get_ephemeral_string (tvb, offset, 64);
+ hostname = tvb_get_string (wmem_packet_scope(), tvb, offset, 64);
offset += 64; /* some reason this 114 seems to be incorrect... cutting 4 short to compensate.... */
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, " hostName: %s", hostname);
@@ -480,7 +480,7 @@ typedef [string] byte NameString_t[AFS_NAMEMAX];
proto_tree_add_item (tree,
hf_fldb_afsNameString_t_principalName_string,
tvb, offset, string_size, ENC_ASCII|ENC_NA);
- namestring = tvb_get_ephemeral_string (tvb, offset, string_size);
+ namestring = tvb_get_string (wmem_packet_scope(), tvb, offset, string_size);
offset += string_size;
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s", namestring);
@@ -706,7 +706,7 @@ dissect_vldbentry (tvbuff_t * tvb, int offset,
proto_tree_add_item (tree, hf_fldb_vldbentry_volumename, tvb, offset, 114,
ENC_ASCII|ENC_NA);
- volumename = tvb_get_ephemeral_string (tvb, offset, 114);
+ volumename = tvb_get_string (wmem_packet_scope(), tvb, offset, 114);
offset += 110; /* some reason this 114 seems to be incorrect... cutting 4 short to compensate.... */
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, " Name: %s", volumename);
@@ -774,7 +774,7 @@ dissect_vldbentry (tvbuff_t * tvb, int offset,
{
proto_tree_add_item (tree, hf_fldb_vldbentry_siteprincipal, tvb,
offset, 64, ENC_ASCII|ENC_NA);
- siteprincipal = tvb_get_ephemeral_string (tvb, offset, 64);
+ siteprincipal = tvb_get_string (wmem_packet_scope(), tvb, offset, 64);
offset += 64;
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, " Princ: %s", siteprincipal);
@@ -952,7 +952,7 @@ dissect_vldbentry (tvbuff_t * tvb, int offset,
/* byte LockerName[MAXLOCKNAMELEN]; */
proto_tree_add_item (tree, hf_fldb_vldbentry_lockername, tvb, offset,
MAXLOCKNAMELEN, ENC_ASCII|ENC_NA);
- lockername = tvb_get_ephemeral_string (tvb, offset, MAXLOCKNAMELEN);
+ lockername = tvb_get_string (wmem_packet_scope(), tvb, offset, MAXLOCKNAMELEN);
offset += MAXLOCKNAMELEN; /* some reason this 114 seems to be incorrect... cutting 4 short to compensate.... */
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, " LockerName: %s", lockername);
@@ -960,7 +960,7 @@ dissect_vldbentry (tvbuff_t * tvb, int offset,
/* byte charSpares[50]; */
proto_tree_add_item (tree, hf_fldb_vldbentry_charspares, tvb, offset, 50,
ENC_ASCII|ENC_NA);
- charspares = tvb_get_ephemeral_string (tvb, offset, 50);
+ charspares = tvb_get_string (wmem_packet_scope(), tvb, offset, 50);
offset += 50; /* some reason this 114 seems to be incorrect... cutting 4 short to compensate.... */
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, " charSpares:%s", charspares);
@@ -1118,7 +1118,7 @@ fldb_dissect_getsiteinfo_resp (tvbuff_t * tvb, int offset,
offset += 48; /* part of kerbprin before name... */
proto_tree_add_item (tree, hf_fldb_namestring, tvb, offset, 64, ENC_ASCII|ENC_NA);
- namestring = tvb_get_ephemeral_string (tvb, offset, 64);
+ namestring = tvb_get_string (wmem_packet_scope(), tvb, offset, 64);
offset += 64;
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, " %s", namestring);
diff --git a/epan/dissectors/packet-dcerpc-netlogon.c b/epan/dissectors/packet-dcerpc-netlogon.c
index b088cc1541..35a527488e 100644
--- a/epan/dissectors/packet-dcerpc-netlogon.c
+++ b/epan/dissectors/packet-dcerpc-netlogon.c
@@ -7982,7 +7982,7 @@ dissect_packet_data(tvbuff_t *tvb ,tvbuff_t *auth_tvb _U_,
}
crypt_rc4_init(&rc4state,vars->encryption_key,16);
crypt_rc4(&rc4state,(guint8*)&copyconfounder,8);
- decrypted = (guint8*)tvb_g_memdup(tvb, offset,data_len);
+ decrypted = (guint8*)tvb_memdup(NULL, tvb, offset,data_len);
crypt_rc4_init(&rc4state,vars->encryption_key,16);
crypt_rc4(&rc4state,decrypted,data_len);
buf = tvb_new_child_real_data(tvb, decrypted, data_len, data_len);
diff --git a/epan/dissectors/packet-dcerpc-nt.c b/epan/dissectors/packet-dcerpc-nt.c
index 72f2902a49..65b9ba6b7f 100644
--- a/epan/dissectors/packet-dcerpc-nt.c
+++ b/epan/dissectors/packet-dcerpc-nt.c
@@ -129,8 +129,8 @@ dissect_null_term_string(tvbuff_t *tvb, int offset,
}
len = tmp_offset - offset;
- /* tvb_get_ephemeral_string didn't want the length with the 0*/
- s = tvb_get_ephemeral_string(tvb, offset, len);
+ /* tvb_get_string didn't want the length with the 0*/
+ s = tvb_get_string(wmem_packet_scope(), tvb, offset, len);
proto_tree_add_string(tree, hf_index, tvb, offset, len + 1, s);
return tmp_offset;
@@ -165,8 +165,8 @@ dissect_null_term_wstring(tvbuff_t *tvb, int offset,
}
len = tmp_offset - offset;
- /* tvb_get_ephemeral_string didn't want the length with the 0*/
- s = tvb_get_g_unicode_string(tvb, offset, len, ENC_LITTLE_ENDIAN);
+ /* tvb_get_string didn't want the length with the 0*/
+ s = tvb_get_unicode_string(NULL, tvb, offset, len, ENC_LITTLE_ENDIAN);
proto_tree_add_string(tree, hf_index, tvb, offset, len, s);
g_free(s);
@@ -1285,7 +1285,7 @@ void cb_wstr_postprocess(packet_info *pinfo, proto_tree *tree _U_,
* some way we can get that string, rather than duplicating the
* efforts of that routine?
*/
- s = tvb_get_ephemeral_unicode_string(
+ s = tvb_get_unicode_string(wmem_packet_scope(),
tvb, start_offset + 12, end_offset - start_offset - 12,
ENC_LITTLE_ENDIAN);
@@ -1348,7 +1348,7 @@ void cb_str_postprocess(packet_info *pinfo, proto_tree *tree _U_,
* some way we can get that string, rather than duplicating the
* efforts of that routine?
*/
- s = tvb_get_ephemeral_string(
+ s = tvb_get_string(wmem_packet_scope(),
tvb, start_offset + 12, (end_offset - start_offset - 12) );
/* Append string to COL_INFO */
diff --git a/epan/dissectors/packet-dcerpc-rpriv.c b/epan/dissectors/packet-dcerpc-rpriv.c
index cae13841f8..dbfd17f45a 100644
--- a/epan/dissectors/packet-dcerpc-rpriv.c
+++ b/epan/dissectors/packet-dcerpc-rpriv.c
@@ -77,13 +77,13 @@ rpriv_dissect_get_eptgt_rqst (tvbuff_t *tvb, int offset,
/* advance to get size of cell, and princ */
proto_tree_add_item (tree, hf_rpriv_get_eptgt_rqst_key_t, tvb, offset, key_size, ENC_ASCII|ENC_NA);
- key_t1 = tvb_get_ephemeral_string(tvb, offset, key_size);
+ key_t1 = tvb_get_string(wmem_packet_scope(), tvb, offset, key_size);
offset += key_size;
offset += 8;
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_rpriv_get_eptgt_rqst_key_size2, &key_size2);
proto_tree_add_item (tree, hf_rpriv_get_eptgt_rqst_key_t2, tvb, offset, key_size2, ENC_ASCII|ENC_NA);
- key_t2 = tvb_get_ephemeral_string(tvb, offset, key_size2);
+ key_t2 = tvb_get_string(wmem_packet_scope(), tvb, offset, key_size2);
offset += key_size2;
diff --git a/epan/dissectors/packet-dcerpc-rs_acct.c b/epan/dissectors/packet-dcerpc-rs_acct.c
index 06b8647d21..c74e5fc43f 100644
--- a/epan/dissectors/packet-dcerpc-rs_acct.c
+++ b/epan/dissectors/packet-dcerpc-rs_acct.c
@@ -66,7 +66,7 @@ rs_acct_dissect_lookup_rqst (tvbuff_t *tvb, int offset,
if (key_size){ /* Not able to yet decipher the OTHER versions of this call just yet. */
proto_tree_add_item (tree, hf_rs_acct_lookup_rqst_key_t, tvb, offset, key_size, ENC_ASCII|ENC_NA);
- keyx_t = tvb_get_ephemeral_string(tvb, offset, key_size);
+ keyx_t = tvb_get_string(wmem_packet_scope(), tvb, offset, key_size);
offset += key_size;
if (check_col(pinfo->cinfo, COL_INFO)) {
@@ -97,7 +97,7 @@ rs_acct_dissect_get_projlist_rqst (tvbuff_t *tvb, int offset,
proto_tree_add_item (tree, hf_rs_acct_get_projlist_rqst_key_t,
tvb, offset, key_size, ENC_ASCII|ENC_NA);
- keyx_t = tvb_get_ephemeral_string(tvb, offset, key_size);
+ keyx_t = tvb_get_string(wmem_packet_scope(), tvb, offset, key_size);
offset += key_size;
if (check_col(pinfo->cinfo, COL_INFO)) {
diff --git a/epan/dissectors/packet-dcerpc-rs_misc.c b/epan/dissectors/packet-dcerpc-rs_misc.c
index bebeb2ed6a..a0f39cce38 100644
--- a/epan/dissectors/packet-dcerpc-rs_misc.c
+++ b/epan/dissectors/packet-dcerpc-rs_misc.c
@@ -64,7 +64,7 @@ rs_misc_dissect_login_get_info_rqst (tvbuff_t *tvb, int offset,
if (key_size){ /* Not able to yet decipher the OTHER versions of this call just yet. */
proto_tree_add_item (tree, hf_rs_misc_login_get_info_rqst_key_t, tvb, offset, key_size, ENC_ASCII|ENC_NA);
- key_t1 = tvb_get_ephemeral_string(tvb, offset, key_size);
+ key_t1 = tvb_get_string(wmem_packet_scope(), tvb, offset, key_size);
offset += key_size;
if (check_col(pinfo->cinfo, COL_INFO)) {
diff --git a/epan/dissectors/packet-dcerpc-rs_pgo.c b/epan/dissectors/packet-dcerpc-rs_pgo.c
index 4f4d0e1caa..ee1bce178b 100644
--- a/epan/dissectors/packet-dcerpc-rs_pgo.c
+++ b/epan/dissectors/packet-dcerpc-rs_pgo.c
@@ -207,7 +207,7 @@ dissect sec_rgy_pname const signed32 sec_rgy_pname_t_size = 257; * In
{
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s",
- tvb_get_ephemeral_string(tvb, offset, string_size));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, string_size));
}
offset += string_size;
}
@@ -429,7 +429,7 @@ dissect_sec_rgy_name_t (tvbuff_t * tvb, int offset,
{
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s",
- tvb_get_ephemeral_string (tvb, offset, string_size));
+ tvb_get_string (wmem_packet_scope(), tvb, offset, string_size));
}
offset += string_size;
}
diff --git a/epan/dissectors/packet-dcerpc-spoolss.c b/epan/dissectors/packet-dcerpc-spoolss.c
index 899140db53..627c3d22ae 100644
--- a/epan/dissectors/packet-dcerpc-spoolss.c
+++ b/epan/dissectors/packet-dcerpc-spoolss.c
@@ -700,7 +700,7 @@ dissect_printerdata_data(tvbuff_t *tvb, int offset,
switch(type) {
case DCERPC_REG_SZ: {
- char *data = tvb_get_g_unicode_string(tvb, offset - size, size, ENC_LITTLE_ENDIAN);
+ char *data = tvb_get_unicode_string(NULL, tvb, offset - size, size, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, ": %s", data);
@@ -1099,7 +1099,7 @@ dissect_spoolss_uint16uni(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
return offset;
}
- text = tvb_get_g_unicode_string(tvb, offset, remaining, ENC_LITTLE_ENDIAN);
+ text = tvb_get_unicode_string(NULL, tvb, offset, remaining, ENC_LITTLE_ENDIAN);
len = (int)strlen(text);
proto_tree_add_text(tree, tvb, offset, len * 2, "%s: %s",
@@ -5908,7 +5908,7 @@ cb_notify_str_postprocess(packet_info *pinfo _U_,
len = tvb_get_letohl(tvb, start_offset);
- s = tvb_get_g_unicode_string(
+ s = tvb_get_unicode_string(NULL,
tvb, start_offset + 4, (end_offset - start_offset - 4), ENC_LITTLE_ENDIAN);
/* Append string to upper-level proto_items */
diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c
index d6d86b4b55..41a9f76197 100644
--- a/epan/dissectors/packet-dcerpc.c
+++ b/epan/dissectors/packet-dcerpc.c
@@ -1686,7 +1686,7 @@ dissect_ndr_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree_add_item() with the appropriate ENC_ value? */
/* XXX - should this ever be used with something that's *not*
an FT_STRING? */
- s = tvb_get_ephemeral_unicode_string(tvb, offset, buffer_len, ENC_LITTLE_ENDIAN);
+ s = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, buffer_len, ENC_LITTLE_ENDIAN);
if (tree && buffer_len) {
hfinfo = proto_registrar_get_nth(hfindex);
tvb_ensure_bytes_exist(tvb, offset, buffer_len);
@@ -1701,7 +1701,7 @@ dissect_ndr_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo,
} else {
/*
- * "tvb_get_ephemeral_string()" throws an exception if the entire string
+ * "tvb_get_string()" throws an exception if the entire string
* isn't in the tvbuff. If the length is bogus, this should
* keep us from trying to allocate an immensely large buffer.
* (It won't help if the length is *valid* but immensely large,
@@ -1713,7 +1713,7 @@ dissect_ndr_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo,
* octet string? What if size_is is neither 1 nor 2?
*/
tvb_ensure_bytes_exist(tvb, offset, buffer_len);
- s = tvb_get_ephemeral_string(tvb, offset, buffer_len);
+ s = tvb_get_string(wmem_packet_scope(), tvb, offset, buffer_len);
if (tree && buffer_len)
proto_tree_add_item(string_tree, hfindex, tvb, offset,
buffer_len, DREP_ENC_INTEGER(drep));
@@ -1875,7 +1875,7 @@ dissect_ndr_vstring(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree_add_item() with the appropriate ENC_ value? */
/* XXX - should this ever be used with something that's *not*
an FT_STRING? */
- s = tvb_get_ephemeral_unicode_string(tvb, offset, buffer_len, ENC_LITTLE_ENDIAN);
+ s = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, buffer_len, ENC_LITTLE_ENDIAN);
if (tree && buffer_len) {
hfinfo = proto_registrar_get_nth(hfindex);
tvb_ensure_bytes_exist(tvb, offset, buffer_len);
@@ -1890,7 +1890,7 @@ dissect_ndr_vstring(tvbuff_t *tvb, int offset, packet_info *pinfo,
} else {
/*
- * "tvb_get_ephemeral_string()" throws an exception if the entire string
+ * "tvb_get_string()" throws an exception if the entire string
* isn't in the tvbuff. If the length is bogus, this should
* keep us from trying to allocate an immensely large buffer.
* (It won't help if the length is *valid* but immensely large,
@@ -1902,7 +1902,7 @@ dissect_ndr_vstring(tvbuff_t *tvb, int offset, packet_info *pinfo,
* octet string? What if size_is is neither 1 nor 2?
*/
tvb_ensure_bytes_exist(tvb, offset, buffer_len);
- s = tvb_get_ephemeral_string(tvb, offset, buffer_len);
+ s = tvb_get_string(wmem_packet_scope(), tvb, offset, buffer_len);
if (tree && buffer_len)
proto_tree_add_item(string_tree, hfindex, tvb, offset,
buffer_len, DREP_ENC_INTEGER(drep));
@@ -4193,7 +4193,7 @@ dissect_dcerpc_cn_rts(tvbuff_t *tvb, gint offset, packet_info *pinfo,
const guint32 conformance_count = dcerpc_tvb_get_ntohl(tvb, offset, hdr->drep);
proto_tree_add_uint(cn_rts_command_tree, hf_dcerpc_cn_rts_command_conformancecount, tvb, offset, 4, conformance_count);
offset += 4;
- padding = (guint8 *)tvb_g_memdup(tvb, offset, conformance_count);
+ padding = (guint8 *)tvb_memdup(NULL, tvb, offset, conformance_count);
proto_tree_add_bytes(cn_rts_command_tree, hf_dcerpc_cn_rts_command_padding, tvb, offset, conformance_count, padding);
offset += conformance_count;
} break;
@@ -4219,7 +4219,7 @@ dissect_dcerpc_cn_rts(tvbuff_t *tvb, gint offset, packet_info *pinfo,
offset += 16;
} break;
}
- padding = (guint8 *)tvb_g_memdup(tvb, offset, 12);
+ padding = (guint8 *)tvb_memdup(NULL, tvb, offset, 12);
proto_tree_add_bytes(cn_rts_command_tree, hf_dcerpc_cn_rts_command_padding, tvb, offset, 12, padding);
offset += 12;
} break;
diff --git a/epan/dissectors/packet-dcm.c b/epan/dissectors/packet-dcm.c
index 1dcc0b96db..94bec0c7ad 100644
--- a/epan/dissectors/packet-dcm.c
+++ b/epan/dissectors/packet-dcm.c
@@ -4926,7 +4926,7 @@ dissect_dcm_assoc_item(tvbuff_t *tvb, proto_tree *tree, guint32 offset,
switch (item_value_type) {
case DCM_ITEM_VALUE_TYPE_UID:
- *item_value = (gchar *)tvb_get_ephemeral_string(tvb, offset+4, item_len);
+ *item_value = (gchar *)tvb_get_string(wmem_packet_scope(), tvb, offset+4, item_len);
uid = (dcm_uid_t *)g_hash_table_lookup(dcm_uid_table, (gpointer) *item_value);
if (uid) {
@@ -4944,7 +4944,7 @@ dissect_dcm_assoc_item(tvbuff_t *tvb, proto_tree *tree, guint32 offset,
break;
case DCM_ITEM_VALUE_TYPE_STRING:
- *item_value = (gchar *)tvb_get_ephemeral_string(tvb, offset+4, item_len);
+ *item_value = (gchar *)tvb_get_string(wmem_packet_scope(), tvb, offset+4, item_len);
proto_item_append_text(assoc_item_pitem, "%s", *item_value);
proto_tree_add_string(assoc_item_ptree, *hf_value, tvb, offset+4, item_len, *item_value);
@@ -4997,7 +4997,7 @@ dissect_dcm_assoc_sopclass_extneg(tvbuff_t *tvb, proto_tree *tree, guint32 offse
proto_tree_add_item(assoc_item_extneg_tree, hf_dcm_assoc_item_len, tvb, offset+2, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(assoc_item_extneg_tree, hf_dcm_info_extneg_sopclassuid_len, tvb, offset+4, 2, ENC_BIG_ENDIAN);
- sopclassuid_str = (gchar *)tvb_get_ephemeral_string(tvb, offset+6, sop_class_uid_len);
+ sopclassuid_str = (gchar *)tvb_get_string(wmem_packet_scope(), tvb, offset+6, sop_class_uid_len);
sopclassuid = (dcm_uid_t *)g_hash_table_lookup(dcm_uid_table, (gpointer) sopclassuid_str);
if (sopclassuid) {
@@ -5099,7 +5099,7 @@ dissect_dcm_assoc_role_selection(tvbuff_t *tvb, proto_tree *tree, guint32 offset
proto_tree_add_item(assoc_item_rolesel_tree, hf_dcm_assoc_item_len, tvb, offset+2, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(assoc_item_rolesel_tree, hf_dcm_info_rolesel_sopclassuid_len, tvb, offset+4, 2, ENC_BIG_ENDIAN);
- sopclassuid_str = (gchar *)tvb_get_ephemeral_string(tvb, offset+6, sop_class_uid_len);
+ sopclassuid_str = (gchar *)tvb_get_string(wmem_packet_scope(), tvb, offset+6, sop_class_uid_len);
sopclassuid = (dcm_uid_t *)g_hash_table_lookup(dcm_uid_table, (gpointer) sopclassuid_str);
scu_role = tvb_get_guint8(tvb, offset+6+sop_class_uid_len);
@@ -6201,7 +6201,7 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Controlled exit, if VR does not fit. */
if (dcm_tag_is_open(pdv, offset_tag, offset_vr, endpos, 2)) return endpos;
- vr = (gchar *)tvb_get_ephemeral_string(tvb, offset, 2);
+ vr = (gchar *)tvb_get_string(wmem_packet_scope(), tvb, offset, 2);
offset += 2;
g_free(pdv->open_tag.vr);
diff --git a/epan/dissectors/packet-dcp-etsi.c b/epan/dissectors/packet-dcp-etsi.c
index e4b9d5ab56..e2a3369fe5 100644
--- a/epan/dissectors/packet-dcp-etsi.c
+++ b/epan/dissectors/packet-dcp-etsi.c
@@ -179,7 +179,7 @@ dissect_dcp_etsi (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void *
if(tvb_length(tvb) < 11)
return FALSE;
- sync = tvb_get_ephemeral_string (tvb, 0, 2);
+ sync = tvb_get_string (wmem_packet_scope(), tvb, 0, 2);
if((sync[0]!='A' && sync[0]!='P') || sync[1]!='F')
return FALSE;
@@ -636,14 +636,14 @@ dissect_tpl(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
while(offset<tvb_length(tvb)) {
guint32 bits;
guint32 bytes;
- char *tag = (char*)tvb_get_ephemeral_string (tvb, offset, 4); offset += 4;
+ char *tag = (char*)tvb_get_string (wmem_packet_scope(), tvb, offset, 4); offset += 4;
bits = tvb_get_ntohl(tvb, offset); offset += 4;
bytes = bits / 8;
if(bits % 8)
bytes++;
if(tree) {
if(strcmp(tag, "*ptr")==0) {
- prot = (char*)tvb_get_ephemeral_string (tvb, offset, 4);
+ prot = (char*)tvb_get_string (wmem_packet_scope(), tvb, offset, 4);
maj = tvb_get_ntohs(tvb, offset+4);
min = tvb_get_ntohs(tvb, offset+6);
proto_tree_add_bytes_format(tpl_tree, hf_tpl_tlv, tvb,
diff --git a/epan/dissectors/packet-dec-dnart.c b/epan/dissectors/packet-dec-dnart.c
index a793019ce8..3e4ef23a30 100644
--- a/epan/dissectors/packet-dec-dnart.c
+++ b/epan/dissectors/packet-dec-dnart.c
@@ -462,7 +462,7 @@ dissect_dec_rt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 3;
ti = proto_tree_add_item(rt_tree, hf_dec_rt_dst_addr, tvb,
offset, 6, ENC_NA);
- addr = dnet_ntoa((const guint8 *)ep_tvb_memdup(tvb, offset, 6));
+ addr = dnet_ntoa((const guint8 *)tvb_memdup(wmem_packet_scope(), tvb, offset, 6));
if (addr != NULL) {
proto_item_append_text(ti, " (%s)", addr);
}
@@ -473,7 +473,7 @@ dissect_dec_rt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 8;
ti = proto_tree_add_item(rt_tree, hf_dec_rt_src_addr, tvb,
offset, 6, ENC_NA);
- addr = dnet_ntoa((const guint8 *)ep_tvb_memdup(tvb, offset, 6));
+ addr = dnet_ntoa((const guint8 *)tvb_memdup(wmem_packet_scope(), tvb, offset, 6));
if (addr != NULL) {
proto_item_append_text(ti, " (%s)", addr);
}
@@ -720,7 +720,7 @@ do_hello_msg(
my_offset +=3;
ti = proto_tree_add_item(tree, hf_dec_rt_id, tvb,
my_offset, 6, ENC_NA);
- addr = dnet_ntoa((const guint8 *)ep_tvb_memdup(tvb, my_offset, 6));
+ addr = dnet_ntoa((const guint8 *)tvb_memdup(wmem_packet_scope(), tvb, my_offset, 6));
if (addr != NULL) {
proto_item_append_text(ti, " (%s)", addr);
}
@@ -764,7 +764,7 @@ do_hello_msg(
my_offset += 8;
ti = proto_tree_add_item(tree, hf_dec_rt_neighbor, tvb,
my_offset, 6, ENC_NA);
- addr = dnet_ntoa((const guint8 *)ep_tvb_memdup(tvb, my_offset, 6));
+ addr = dnet_ntoa((const guint8 *)tvb_memdup(wmem_packet_scope(), tvb, my_offset, 6));
if (addr != NULL) {
proto_item_append_text(ti, " (%s)", addr);
}
@@ -813,7 +813,7 @@ do_hello_msg(
ti_localb = proto_tree_add_item(list_ether, hf_dec_rt_router_id,
tvb, my_offset, 6, ENC_NA);
- addr = dnet_ntoa((const guint8 *)ep_tvb_memdup(tvb, my_offset, 6));
+ addr = dnet_ntoa((const guint8 *)tvb_memdup(wmem_packet_scope(), tvb, my_offset, 6));
if (addr != NULL) {
proto_item_append_text(ti_localb, " (%s)", addr);
}
diff --git a/epan/dissectors/packet-dhcp-failover.c b/epan/dissectors/packet-dhcp-failover.c
index a32b8edae2..47fad19997 100644
--- a/epan/dissectors/packet-dhcp-failover.c
+++ b/epan/dissectors/packet-dhcp-failover.c
@@ -569,7 +569,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* XXX - if this is truly like DHCP option 81,
* we need to dissect it as such.
*/
- proto_item_append_text(oi,", \"%s\"", tvb_get_ephemeral_string(tvb, offset, option_length));
+ proto_item_append_text(oi,", \"%s\"", tvb_get_string(wmem_packet_scope(), tvb, offset, option_length));
proto_tree_add_item(option_tree,
hf_dhcpfo_client_identifier, tvb, offset,
@@ -634,7 +634,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case DHCP_FO_PD_VENDOR_CLASS:
vendor_class_str =
- tvb_get_ephemeral_string(tvb, offset, option_length);
+ tvb_get_string(wmem_packet_scope(), tvb, offset, option_length);
proto_item_append_text(oi,", \"%s\"",
format_text(vendor_class_str, option_length));
proto_tree_add_string(option_tree,
diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c
index b0927f9739..f55273f866 100644
--- a/epan/dissectors/packet-dhcpv6.c
+++ b/epan/dissectors/packet-dhcpv6.c
@@ -688,7 +688,7 @@ swap_field_length_with_char(tvbuff_t* tvb, wmem_strbuf_t* strbuf, gint offset, g
offset++;
len_cnt++;
- wmem_strbuf_append(strbuf, tvb_get_ephemeral_string(tvb, offset, next_length));
+ wmem_strbuf_append(strbuf, tvb_get_string(wmem_packet_scope(), tvb, offset, next_length));
len_cnt += next_length;
/* Do not append replacement character to end of string. */
@@ -1099,7 +1099,7 @@ dissect_cablelabs_specific_opts(proto_tree *v_tree, proto_item *v_item, packet_i
opt_len = tlv_len;
field_len = tlv_len;
- device_type = tvb_get_ephemeral_string(tvb, sub_off, field_len);
+ device_type = tvb_get_string(wmem_packet_scope(), tvb, sub_off, field_len);
if (device_type == NULL || strlen(device_type) == 0) {
proto_item_append_text(ti, "Packet does not contain Device Type.");
diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c
index e667cb4471..3a2e4d35b8 100644
--- a/epan/dissectors/packet-dmp.c
+++ b/epan/dissectors/packet-dmp.c
@@ -1652,7 +1652,7 @@ static void dmp_add_seq_ack_analysis (tvbuff_t *tvb, packet_info *pinfo,
static gchar *dissect_7bit_string (tvbuff_t *tvb, gint offset, gint length)
{
- guchar *encoded = tvb_get_ephemeral_string (tvb, offset, length);
+ guchar *encoded = tvb_get_string (wmem_packet_scope(), tvb, offset, length);
guchar *decoded = (guchar *)wmem_alloc0 (wmem_packet_scope(), (size_t)(length * 1.2) + 1);
guchar rest = 0, bits = 1;
gint len = 0, i;
@@ -3049,7 +3049,7 @@ static void dissect_dmp_structured_id (tvbuff_t *tvb, proto_tree *body_tree,
break;
case STRUCT_ID_STRING:
- dmp.struct_id = tvb_get_ephemeral_string (tvb, offset, (gint) dmp_struct_length);
+ dmp.struct_id = tvb_get_string (wmem_packet_scope(), tvb, offset, (gint) dmp_struct_length);
proto_tree_add_item (body_tree, hf_message_bodyid_string, tvb, offset, dmp_struct_length, ENC_ASCII|ENC_NA);
break;
@@ -3081,7 +3081,7 @@ static gint dissect_dmp_message (tvbuff_t *tvb, packet_info *pinfo,
if (dmp.body_format == FREE_TEXT_SUBJECT) {
len = tvb_strsize (tvb, offset);
if (dmp_subject_as_id) {
- dmp.struct_id = tvb_get_ephemeral_string (tvb, offset, len);
+ dmp.struct_id = tvb_get_string (wmem_packet_scope(), tvb, offset, len);
}
proto_tree_add_item (message_tree, hf_message_subject, tvb, offset, len, ENC_ASCII|ENC_NA);
offset += len;
diff --git a/epan/dissectors/packet-dnp.c b/epan/dissectors/packet-dnp.c
index 6d8bdce4a2..b276521222 100644
--- a/epan/dissectors/packet-dnp.c
+++ b/epan/dissectors/packet-dnp.c
@@ -2453,7 +2453,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset,
if (al_filename_len > 0) {
const gchar *al_filename;
- al_filename = tvb_get_ephemeral_string(tvb, data_pos, al_filename_len);
+ al_filename = tvb_get_string(wmem_packet_scope(), tvb, data_pos, al_filename_len);
proto_tree_add_text(point_tree, tvb, data_pos, al_filename_len, "File Name: %s", al_filename);
}
data_pos += al_filename_len;
diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c
index a0ef6a206a..99f5944ef0 100644
--- a/epan/dissectors/packet-dns.c
+++ b/epan/dissectors/packet-dns.c
@@ -1973,10 +1973,10 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
cpu_offset = cur_offset;
cpu_len = tvb_get_guint8(tvb, cpu_offset);
- cpu = tvb_get_ephemeral_string(tvb, cpu_offset + 1, cpu_len);
+ cpu = tvb_get_string(wmem_packet_scope(), tvb, cpu_offset + 1, cpu_len);
os_offset = cpu_offset + 1 + cpu_len;
os_len = tvb_get_guint8(tvb, os_offset);
- os = tvb_get_ephemeral_string(tvb, os_offset + 1, os_len);
+ os = tvb_get_string(wmem_packet_scope(), tvb, os_offset + 1, os_len);
if (cinfo != NULL) {
col_append_fstr(cinfo, COL_INFO, " %.*s %.*s", cpu_len, cpu,
os_len, os);
@@ -2450,7 +2450,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
flags_len = tvb_get_guint8(tvb, offset);
offset += 1;
proto_tree_add_item(rr_tree, hf_dns_naptr_flags, tvb, offset, flags_len, ENC_ASCII|ENC_NA);
- flags = tvb_get_ephemeral_string(tvb, offset, flags_len);
+ flags = tvb_get_string(wmem_packet_scope(), tvb, offset, flags_len);
offset += flags_len;
/* Service */
@@ -3380,10 +3380,10 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
cur_offset++;
tag_len = tvb_get_guint8(tvb, cur_offset);
- tag = tvb_get_ephemeral_string(tvb, cur_offset + 1, tag_len);
+ tag = tvb_get_string(wmem_packet_scope(), tvb, cur_offset + 1, tag_len);
value_len = data_len - (tag_len + 2);
- value = tvb_get_ephemeral_string(tvb, cur_offset + 1 + tag_len, value_len);
+ value = tvb_get_string(wmem_packet_scope(), tvb, cur_offset + 1 + tag_len, value_len);
value = format_text(value, value_len);
diff --git a/epan/dissectors/packet-dsi.c b/epan/dissectors/packet-dsi.c
index a763085d33..b17eb32837 100644
--- a/epan/dissectors/packet-dsi.c
+++ b/epan/dissectors/packet-dsi.c
@@ -438,7 +438,7 @@ dissect_dsi_reply_get_status(tvbuff_t *tvb, proto_tree *tree, gint offset)
case 4: /* DNS */
case 5: /* SSH tunnel */
if (len > 2) {
- tmp = tvb_get_ephemeral_string(tvb, ofs +2, len -2);
+ tmp = tvb_get_string(wmem_packet_scope(), tvb, ofs +2, len -2);
ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "%s: %s",
(type==4)?"dns":"ssh tunnel", tmp);
break;
@@ -489,7 +489,7 @@ dissect_dsi_reply_get_status(tvbuff_t *tvb, proto_tree *tree, gint offset)
ofs = utf_ofs;
ulen = tvb_get_ntohs(tvb, ofs);
- tmp = tvb_get_ephemeral_string(tvb, ofs + 2, ulen);
+ tmp = tvb_get_string(wmem_packet_scope(), tvb, ofs + 2, ulen);
ti = proto_tree_add_text(tree, tvb, ofs, ulen + 2, "UTF8 server name: %s", tmp);
sub_tree = proto_item_add_subtree(ti, ett_dsi_utf8_name);
proto_tree_add_uint(sub_tree, hf_dsi_utf8_server_name_len, tvb, ofs, 2, ulen);
diff --git a/epan/dissectors/packet-dtn.c b/epan/dissectors/packet-dtn.c
index 339077e0cb..508b982dd1 100644
--- a/epan/dissectors/packet-dtn.c
+++ b/epan/dissectors/packet-dtn.c
@@ -1543,7 +1543,7 @@ display_metadata_block(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int
/* and second is the creator custodian EID */
cteb_creator_custodian_eid_length = block_length - sdnv_length;
- cteb_creator_custodian_eid = (char *) tvb_get_ephemeral_string(tvb, offset, cteb_creator_custodian_eid_length);
+ cteb_creator_custodian_eid = (char *) tvb_get_string(wmem_packet_scope(), tvb, offset, cteb_creator_custodian_eid_length);
ti = proto_tree_add_string(block_tree, hf_block_control_block_cteb_creator_custodian_eid, tvb, offset,
cteb_creator_custodian_eid_length, cteb_creator_custodian_eid);
diff --git a/epan/dissectors/packet-dtpt.c b/epan/dissectors/packet-dtpt.c
index e33bb69cd8..1d8f9104e8 100644
--- a/epan/dissectors/packet-dtpt.c
+++ b/epan/dissectors/packet-dtpt.c
@@ -234,7 +234,7 @@ dissect_dtpt_wstring(tvbuff_t *tvb, guint offset, proto_tree *tree, int hfindex)
guint32 wstring_padding = 0;
wstring_length = tvb_get_letohl(tvb, offset);
- wstring_data = tvb_get_ephemeral_unicode_string(tvb, offset+4, wstring_length, ENC_LITTLE_ENDIAN);
+ wstring_data = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset+4, wstring_length, ENC_LITTLE_ENDIAN);
wstring_size = wstring_length;
if (wstring_size%4) {
wstring_padding = (4-wstring_size%4);
diff --git a/epan/dissectors/packet-dua.c b/epan/dissectors/packet-dua.c
index bd791754fe..95a8aa58e7 100644
--- a/epan/dissectors/packet-dua.c
+++ b/epan/dissectors/packet-dua.c
@@ -114,7 +114,7 @@ dissect_text_interface_identifier_parameter(tvbuff_t *parameter_tvb, proto_tree
proto_tree_add_item(parameter_tree, hf_text_interface_id,
parameter_tvb, TEXT_INTERFACE_ID_OFFSET, interface_id_length, ENC_ASCII|ENC_NA);
proto_item_append_text(parameter_item, " (%.*s)", interface_id_length,
- tvb_get_ephemeral_string(parameter_tvb, TEXT_INTERFACE_ID_OFFSET, interface_id_length));
+ tvb_get_string(wmem_packet_scope(), parameter_tvb, TEXT_INTERFACE_ID_OFFSET, interface_id_length));
}
#define INFO_STRING_OFFSET PARAMETER_VALUE_OFFSET
@@ -128,7 +128,7 @@ dissect_info_string_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tre
proto_tree_add_item(parameter_tree, hf_info_string,
parameter_tvb, INFO_STRING_OFFSET, info_string_length, ENC_ASCII|ENC_NA);
proto_item_append_text(parameter_item, " (%.*s)", info_string_length,
- tvb_get_ephemeral_string(parameter_tvb, INFO_STRING_OFFSET, info_string_length));
+ tvb_get_string(wmem_packet_scope(), parameter_tvb, INFO_STRING_OFFSET, info_string_length));
}
#define DLCI_LENGTH 2
diff --git a/epan/dissectors/packet-dvbci.c b/epan/dissectors/packet-dvbci.c
index 716dadb93b..2c65a3626a 100644
--- a/epan/dissectors/packet-dvbci.c
+++ b/epan/dissectors/packet-dvbci.c
@@ -2150,7 +2150,7 @@ decrypt_sac_msg_body(
clear_data = (unsigned char *)g_malloc(clear_len);
err = gcry_cipher_decrypt (cipher, clear_data, clear_len,
- tvb_get_ephemeral_string(encrypted_tvb, offset, len), len);
+ tvb_get_string(wmem_packet_scope(), encrypted_tvb, offset, len), len);
if (gcry_err_code (err))
goto end;
@@ -2218,7 +2218,7 @@ dissect_si_string(tvbuff_t *tvb, gint offset, gint str_len,
str_len--;
}
- si_str = tvb_get_ephemeral_string(tvb, offset, str_len);
+ si_str = tvb_get_string(wmem_packet_scope(), tvb, offset, str_len);
if (!si_str)
return;
@@ -2487,8 +2487,8 @@ dissect_dvbci_payload_ap(guint32 tag, gint len_field _U_,
offset++;
/* ephemeral -> string is freed automatically when dissection
of this packet is finished
- tvb_get_ephemeral_string() always returns a 0-terminated string */
- menu_string = tvb_get_ephemeral_string(tvb, offset, menu_str_len);
+ tvb_get_string() always returns a 0-terminated string */
+ menu_string = tvb_get_string(wmem_packet_scope(), tvb, offset, menu_str_len);
if (menu_string) {
col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL,
"Module name %s", menu_string);
@@ -2988,7 +2988,7 @@ dissect_dvbci_payload_hlc(guint32 tag, gint len_field _U_,
}
/* both apdus' body is only a country code, this can be shared */
- str = tvb_get_ephemeral_string(tvb, offset,
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset,
tvb_reported_length_remaining(tvb, offset));
if (str)
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ": ", "%s", str);
@@ -3342,7 +3342,7 @@ dissect_dvbci_payload_ami(guint32 tag, gint len_field _U_,
offset++;
proto_tree_add_item(tree, hf_dvbci_app_dom_id,
tvb, offset, app_dom_id_len, ENC_ASCII|ENC_NA);
- app_dom_id = tvb_get_ephemeral_string(tvb, offset, app_dom_id_len);
+ app_dom_id = tvb_get_string(wmem_packet_scope(), tvb, offset, app_dom_id_len);
if (app_dom_id) {
col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ",
"for %s", app_dom_id);
@@ -3372,7 +3372,7 @@ dissect_dvbci_payload_ami(guint32 tag, gint len_field _U_,
if (tvb_reported_length_remaining(tvb, offset) <= 0)
break;
if (req_type==REQ_TYPE_FILE || req_type==REQ_TYPE_FILE_HASH) {
- req_str = tvb_get_ephemeral_string(tvb, offset,
+ req_str = tvb_get_string(wmem_packet_scope(), tvb, offset,
tvb_reported_length_remaining(tvb, offset));
if (!req_str)
break;
@@ -3405,7 +3405,7 @@ dissect_dvbci_payload_ami(guint32 tag, gint len_field _U_,
proto_tree_add_text(tree, tvb, offset, 1,
"File name length %d", file_name_len);
offset++;
- file_name_str = tvb_get_ephemeral_string(
+ file_name_str = tvb_get_string(wmem_packet_scope(),
tvb, offset, file_name_len);
if (!file_name_str)
break;
diff --git a/epan/dissectors/packet-edonkey.c b/epan/dissectors/packet-edonkey.c
index eba69162cc..d618ed3ab6 100644
--- a/epan/dissectors/packet-edonkey.c
+++ b/epan/dissectors/packet-edonkey.c
@@ -599,7 +599,7 @@ static guint8 edonkey_metatag_name_get_type(tvbuff_t *tvb, gint start, gint leng
if (try_val_to_str(special_tagtype, edonkey_special_tags) == NULL) {
gint idx;
- tag_name = tvb_get_ephemeral_string(tvb, start, length);
+ tag_name = tvb_get_string(wmem_packet_scope(), tvb, start, length);
idx = lookup_str_index(tag_name, length, edonkey_special_tags);
if (idx < 0)
return EDONKEY_STAG_UNKNOWN;
@@ -916,7 +916,7 @@ static int dissect_kademlia_tagname(tvbuff_t *tvb, packet_info *pinfo _U_,
hidden_item = proto_tree_add_uint(tree, hf_edonkey_string_length, tvb, offset, 2, string_length);
PROTO_ITEM_SET_HIDDEN(hidden_item);
- tagname = tvb_get_ephemeral_string( tvb, offset + 2, string_length );
+ tagname = tvb_get_string(wmem_packet_scope(), tvb, offset + 2, string_length );
tag_full_name = "UnknownTagName";
@@ -948,7 +948,7 @@ static int dissect_kademlia_string(tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree_add_uint(tree, hf_edonkey_string_length, tvb, offset, 2, string_length);
- string_value = tvb_get_ephemeral_string( tvb, offset + 2, string_length );
+ string_value = tvb_get_string(wmem_packet_scope(), tvb, offset + 2, string_length );
proto_tree_add_text(tree, tvb, offset+2, string_length, "String: %s", string_value);
@@ -1089,7 +1089,7 @@ static int dissect_kademlia_tag_string(tvbuff_t *tvb, packet_info *pinfo _U_,
PROTO_ITEM_SET_HIDDEN(hidden_item);
hidden_item = proto_tree_add_item(tree, hf_edonkey_string, tvb, offset+2, string_length, ENC_ASCII|ENC_NA);
PROTO_ITEM_SET_HIDDEN(hidden_item);
- *string_value = tvb_get_ephemeral_string(tvb, offset + 2, string_length);
+ *string_value = tvb_get_string(wmem_packet_scope(), tvb, offset + 2, string_length);
proto_tree_add_item(tree, hf_kademlia_tag_string, tvb, offset + 2, string_length, ENC_ASCII|ENC_NA);
return offset + 2 + string_length;
diff --git a/epan/dissectors/packet-eigrp.c b/epan/dissectors/packet-eigrp.c
index d9e2414cfd..965df4bbe8 100644
--- a/epan/dissectors/packet-eigrp.c
+++ b/epan/dissectors/packet-eigrp.c
@@ -1326,7 +1326,7 @@ dissect_eigrp_service (proto_item *ti, proto_tree *tree, tvbuff_t *tvb,
* followed by a '<'), try XML. Otherwise, try plain-text.
*/
xml_tvb = tvb_new_subset(sub_tvb, sub_offset, length, length);
- test_string = tvb_get_ephemeral_string(xml_tvb, 0, (length < 32 ?
+ test_string = tvb_get_string(wmem_packet_scope(), xml_tvb, 0, (length < 32 ?
length : 32));
tok = strtok(test_string, " \t\r\n");
diff --git a/epan/dissectors/packet-elcom.c b/epan/dissectors/packet-elcom.c
index 4dd8b73409..794045d2a6 100644
--- a/epan/dissectors/packet-elcom.c
+++ b/epan/dissectors/packet-elcom.c
@@ -218,7 +218,7 @@ dissect_lower_address(proto_item *ti_arg, gint ett_arg,
offset += 8; /* skip the zero bytes */
/* SUFFIX */
- suffix = tvb_get_ephemeral_string(tvb, offset+1, len2);
+ suffix = tvb_get_string(wmem_packet_scope(), tvb, offset+1, len2);
ti = proto_tree_add_item(tree, hf_suff, tvb, offset, 1, ENC_ASCII|ENC_LITTLE_ENDIAN);
offset += len2+1;
@@ -450,7 +450,7 @@ dissect_elcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_get_guint8(tvb, 3+1+TOTAL_LEN+LOWADR_LEN) != SUFFIX_LEN) return;
/* finally believe that there is valid suffix */
- suffix = tvb_get_ephemeral_string(tvb, 3+2+LOWADR_LEN, 2);
+ suffix = tvb_get_string(wmem_packet_scope(), tvb, 3+2+LOWADR_LEN, 2);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s Connect", suffix);
break;
diff --git a/epan/dissectors/packet-enrp.c b/epan/dissectors/packet-enrp.c
index 132721324d..abe8785bb6 100644
--- a/epan/dissectors/packet-enrp.c
+++ b/epan/dissectors/packet-enrp.c
@@ -496,7 +496,7 @@ dissect_pool_handle_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tre
handle_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
pi = proto_tree_add_item(parameter_tree, hf_pool_handle, parameter_tvb, POOL_HANDLE_OFFSET, handle_length, ENC_NA);
- tmp = (gchar*)tvb_get_ephemeral_string(parameter_tvb, POOL_HANDLE_OFFSET, handle_length);
+ tmp = (gchar*)tvb_get_string(wmem_packet_scope(), parameter_tvb, POOL_HANDLE_OFFSET, handle_length);
proto_item_append_text(pi, " (%s)", tmp);
}
diff --git a/epan/dissectors/packet-epmd.c b/epan/dissectors/packet-epmd.c
index 957c377b0c..a8f94234f0 100644
--- a/epan/dissectors/packet-epmd.c
+++ b/epan/dissectors/packet-epmd.c
@@ -147,7 +147,7 @@ dissect_epmd_request(packet_info *pinfo, tvbuff_t *tvb, gint offset, proto_tree
name_length = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_epmd_name_len, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_epmd_name, tvb, offset + 2, name_length, ENC_ASCII|ENC_NA);
- name = tvb_get_ephemeral_string(tvb, offset + 2, name_length);
+ name = tvb_get_string(wmem_packet_scope(), tvb, offset + 2, name_length);
offset += 2 + name_length;
if (tvb_length_remaining(tvb, offset) >= 2) {
guint16 elen=0;
@@ -163,7 +163,7 @@ dissect_epmd_request(packet_info *pinfo, tvbuff_t *tvb, gint offset, proto_tree
case EPMD_PORT2_REQ:
name_length = tvb_length_remaining(tvb, offset);
proto_tree_add_item(tree, hf_epmd_name, tvb, offset, name_length, ENC_ASCII|ENC_NA);
- name = tvb_get_ephemeral_string(tvb, offset, name_length);
+ name = tvb_get_string(wmem_packet_scope(), tvb, offset, name_length);
break;
case EPMD_ALIVE_REQ:
@@ -171,7 +171,7 @@ dissect_epmd_request(packet_info *pinfo, tvbuff_t *tvb, gint offset, proto_tree
offset += 2;
name_length = tvb_length_remaining(tvb, offset);
proto_tree_add_item(tree, hf_epmd_name, tvb, offset, name_length, ENC_ASCII|ENC_NA);
- name = tvb_get_ephemeral_string(tvb, offset, name_length);
+ name = tvb_get_string(wmem_packet_scope(), tvb, offset, name_length);
break;
case EPMD_NAMES_REQ:
@@ -250,7 +250,7 @@ dissect_epmd_response(packet_info *pinfo, tvbuff_t *tvb, gint offset, proto_tree
name_length = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_epmd_name_len, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_epmd_name, tvb, offset + 2, name_length, ENC_ASCII|ENC_NA);
- name = tvb_get_ephemeral_string(tvb, offset + 2, name_length);
+ name = tvb_get_string(wmem_packet_scope(), tvb, offset + 2, name_length);
offset += 2 + name_length;
if (tvb_length_remaining(tvb, offset) >= 2) {
guint16 elen=0;
diff --git a/epan/dissectors/packet-erldp.c b/epan/dissectors/packet-erldp.c
index 52db36e8c6..bc11fd86a8 100644
--- a/epan/dissectors/packet-erldp.c
+++ b/epan/dissectors/packet-erldp.c
@@ -239,7 +239,7 @@ static gint dissect_etf_dist_header(packet_info *pinfo _U_, tvbuff_t *tvb, gint
proto_tree_add_uint(acr_tree, hf_erldp_atom_length, tvb, offset, 1, atom_txt_len);
offset++;
}
- str = tvb_get_ephemeral_string(tvb, offset, atom_txt_len);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset, atom_txt_len);
proto_tree_add_item(acr_tree, hf_erldp_atom_text, tvb, offset, atom_txt_len, ENC_NA|ENC_ASCII);
proto_item_append_text(ti_acr, " - '%s'", str);
offset += atom_txt_len;
@@ -448,7 +448,7 @@ static void dissect_erldp_handshake(tvbuff_t *tvb, packet_info *pinfo, proto_tre
offset += 4;
}
str_len = tvb_length_remaining(tvb, offset);
- str = tvb_get_ephemeral_string(tvb, offset, str_len);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset, str_len);
proto_tree_add_item(tree, hf_erldp_name, tvb, offset, str_len, ENC_ASCII|ENC_NA);
col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s", (is_challenge) ? "SEND_CHALLENGE" : "SEND_NAME", str);
break;
@@ -469,7 +469,7 @@ static void dissect_erldp_handshake(tvbuff_t *tvb, packet_info *pinfo, proto_tre
case 's' :
str_len = tvb_length_remaining(tvb, offset);
- str = tvb_get_ephemeral_string(tvb, offset, str_len);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset, str_len);
proto_tree_add_item(tree, hf_erldp_status, tvb, offset, str_len, ENC_ASCII|ENC_NA);
col_add_fstr(pinfo->cinfo, COL_INFO, "SEND_STATUS %s", str);
break;
diff --git a/epan/dissectors/packet-ess.c b/epan/dissectors/packet-ess.c
index 299a2612c4..597aeb79d8 100644
--- a/epan/dissectors/packet-ess.c
+++ b/epan/dissectors/packet-ess.c
@@ -261,7 +261,7 @@ ess_dissect_attribute_flags (tvbuff_t *tvb, asn1_ctx_t *actx)
guint i;
tree = proto_item_add_subtree (actx->created_item, ett_Category_attributes);
- value = tvb_get_ephemeral_string (tvb, 0, tvb_length (tvb));
+ value = tvb_get_string (wmem_packet_scope(), tvb, 0, tvb_length (tvb));
for (i = 0; i < num_ess_category_attributes; i++) {
ess_category_attributes_t *u = &(ess_category_attributes[i]);
diff --git a/epan/dissectors/packet-etsi_card_app_toolkit.c b/epan/dissectors/packet-etsi_card_app_toolkit.c
index 966a20af11..1332e08028 100644
--- a/epan/dissectors/packet-etsi_card_app_toolkit.c
+++ b/epan/dissectors/packet-etsi_card_app_toolkit.c
@@ -1204,7 +1204,7 @@ dissect_cat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case 0x76: /* Geographical Location Parameters / IARI */
if (ims_event) {
proto_tree_add_unicode_string(elem_tree, hf_ctlv_iari, tvb, pos, len,
- tvb_get_ephemeral_string_enc(tvb, pos, len, ENC_UTF_8 | ENC_NA));
+ tvb_get_string_enc(wmem_packet_scope(), tvb, pos, len, ENC_UTF_8 | ENC_NA));
}
break;
case 0x77: /* GAD Shapes / IMPU list */
@@ -1214,7 +1214,7 @@ dissect_cat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_get_guint8(tvb, pos+i) == 0x80) {
g8 = tvb_get_guint8(tvb, pos+i+1);
proto_tree_add_unicode_string(elem_tree, hf_ctlv_impu, tvb, pos+i+2, g8,
- tvb_get_ephemeral_string_enc(tvb, pos+i+2, g8, ENC_UTF_8 | ENC_NA));
+ tvb_get_string_enc(wmem_packet_scope(), tvb, pos+i+2, g8, ENC_UTF_8 | ENC_NA));
i += 2+g8;
} else {
break;
@@ -1224,7 +1224,7 @@ dissect_cat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
case 0x78: /* NMEA sentence / IMS Status-Code */
if (ims_event) {
- guint8 *status_code = tvb_get_ephemeral_string(tvb, pos, len);
+ guint8 *status_code = tvb_get_string(wmem_packet_scope(), tvb, pos, len);
proto_tree_add_string_format_value(elem_tree, hf_ctlv_ims_status_code, tvb, pos, len,
status_code, "%s (%s)", status_code, str_to_str(status_code, ims_status_code, "Unknown"));
}
diff --git a/epan/dissectors/packet-exported_pdu.c b/epan/dissectors/packet-exported_pdu.c
index 36f3acdd39..e90ef1235e 100644
--- a/epan/dissectors/packet-exported_pdu.c
+++ b/epan/dissectors/packet-exported_pdu.c
@@ -125,7 +125,7 @@ dissect_exported_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch(tag){
case EXP_PDU_TAG_PROTO_NAME:
next_proto_type = EXPORTED_PDU_NEXT_PROTO_STR;
- proto_name = tvb_get_ephemeral_string(tvb, offset, tag_len);
+ proto_name = tvb_get_string(wmem_packet_scope(), tvb, offset, tag_len);
proto_tree_add_item(tag_tree, hf_exported_pdu_prot_name, tvb, offset, tag_len, ENC_ASCII|ENC_NA);
break;
case EXP_PDU_TAG_IPV4_SRC:
diff --git a/epan/dissectors/packet-extreme.c b/epan/dissectors/packet-extreme.c
index cd5a9e8af2..d700b71c3c 100644
--- a/epan/dissectors/packet-extreme.c
+++ b/epan/dissectors/packet-extreme.c
@@ -431,7 +431,7 @@ dissect_display_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, p
offset += 4;
length -= 4;
- display_name = tvb_get_ephemeral_string(tvb, offset, length);
+ display_name = tvb_get_string(wmem_packet_scope(), tvb, offset, length);
proto_item_append_text(display_item, ": \"%s\"",
format_text(display_name, strlen(display_name)));
proto_tree_add_string(display_tree, hf_edp_display_string, tvb, offset, length,
@@ -625,7 +625,7 @@ dissect_vlan_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, prot
offset += 4;
length -= 4;
- vlan_name = tvb_get_ephemeral_string(tvb, offset, length);
+ vlan_name = tvb_get_string(wmem_packet_scope(), tvb, offset, length);
proto_item_append_text(vlan_item, ", Name \"%s\"",
format_text(vlan_name, strlen(vlan_name)));
proto_tree_add_string(vlan_tree, hf_edp_vlan_name, tvb, offset, length,
diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c
index d2fd3db82b..852a416ccf 100644
--- a/epan/dissectors/packet-fc.c
+++ b/epan/dissectors/packet-fc.c
@@ -1055,9 +1055,9 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
/* Yes - dissect it. */
if (tree) {
proto_tree_add_string (fc_tree, hf_fc_nh_da, tvb, next_offset, 8,
- fcwwn_to_str (tvb_get_ephemeral_string (tvb, offset, 8)));
+ fcwwn_to_str (tvb_get_string (wmem_packet_scope(), tvb, offset, 8)));
proto_tree_add_string (fc_tree, hf_fc_nh_sa, tvb, offset+8, 8,
- fcwwn_to_str (tvb_get_ephemeral_string (tvb, offset+8, 8)));
+ fcwwn_to_str (tvb_get_string (wmem_packet_scope(), tvb, offset+8, 8)));
}
next_offset += 16;
}
diff --git a/epan/dissectors/packet-fcdns.c b/epan/dissectors/packet-fcdns.c
index bb5823017e..bee916a574 100644
--- a/epan/dissectors/packet-fcdns.c
+++ b/epan/dissectors/packet-fcdns.c
@@ -1281,7 +1281,7 @@ static guint8 *
zonenm_to_str (tvbuff_t *tvb, gint offset)
{
int len = tvb_get_guint8 (tvb, offset);
- return tvb_get_ephemeral_string (tvb, offset+4, len);
+ return tvb_get_string (wmem_packet_scope(), tvb, offset+4, len);
}
static void
@@ -1347,7 +1347,7 @@ dissect_fcdns_swils_entries (tvbuff_t *tvb, proto_tree *tree, int offset)
proto_tree_add_item (tree, &hfi_fcdns_sw2_objfmt, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_string (tree, &hfi_fcdns_rply_ownerid, tvb, offset+1,
- 3, fc_to_str (tvb_get_ephemeral_string (tvb, offset+1,
+ 3, fc_to_str (tvb_get_string (wmem_packet_scope(), tvb, offset+1,
3)));
proto_tree_add_item (tree, &hfi_fcdns_rply_ptype, tvb, offset+4,
1, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-fcgi.c b/epan/dissectors/packet-fcgi.c
index c6e3b5915f..67282b5e48 100644
--- a/epan/dissectors/packet-fcgi.c
+++ b/epan/dissectors/packet-fcgi.c
@@ -127,11 +127,11 @@ dissect_nv_pairs(tvbuff_t *tvb, proto_tree *fcgi_tree, gint offset, guint16 len)
offset += 4;
}
- name = tvb_get_ephemeral_string(tvb, offset, namelen);
+ name = tvb_get_string(wmem_packet_scope(), tvb, offset, namelen);
offset += namelen;
if (valuelen > 0) {
- value = tvb_get_ephemeral_string(tvb, offset, valuelen);
+ value = tvb_get_string(wmem_packet_scope(), tvb, offset, valuelen);
offset += valuelen;
proto_tree_add_text(fcgi_tree, tvb, start_offset, offset - start_offset, "%s = %s", name, value);
diff --git a/epan/dissectors/packet-fcswils.c b/epan/dissectors/packet-fcswils.c
index 769bd3aee5..26f198252c 100644
--- a/epan/dissectors/packet-fcswils.c
+++ b/epan/dissectors/packet-fcswils.c
@@ -469,7 +469,7 @@ static guint8 *
zonenm_to_str(tvbuff_t *tvb, gint offset)
{
int len = tvb_get_guint8(tvb, offset);
- return tvb_get_ephemeral_string(tvb, offset+4, len);
+ return tvb_get_string(wmem_packet_scope(), tvb, offset+4, len);
}
/* Offset points to the start of the zone object */
diff --git a/epan/dissectors/packet-fix.c b/epan/dissectors/packet-fix.c
index 31b8cd296f..9df65e9bd2 100644
--- a/epan/dissectors/packet-fix.c
+++ b/epan/dissectors/packet-fix.c
@@ -118,7 +118,7 @@ static int fix_next_header(tvbuff_t *tvb, int offset)
{
/* try to resync to the next start */
guint min_len = tvb_length_remaining(tvb, offset);
- const guint8 *data = tvb_get_ephemeral_string(tvb, offset, min_len);
+ const guint8 *data = tvb_get_string(wmem_packet_scope(), tvb, offset, min_len);
const guint8 *start = data;
while ((start = strstr(start, "\0018"))) {
@@ -192,7 +192,7 @@ static int fix_header_len(tvbuff_t *tvb, int offset)
return fix_next_header(tvb, offset);
}
- value = tvb_get_ephemeral_string(tvb, tag->value_offset, tag->value_len);
+ value = tvb_get_string(wmem_packet_scope(), tvb, tag->value_offset, tag->value_len);
/* Fix version, msg type, length and checksum aren't in body length.
* If the packet is big enough find the checksum
*/
@@ -270,7 +270,7 @@ dissect_fix_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
return;
}
- value = tvb_get_ephemeral_string(tvb, tag->value_offset, tag->value_len);
+ value = tvb_get_string(wmem_packet_scope(), tvb, tag->value_offset, tag->value_len);
msg_type = str_to_str(value, messages_val, "FIX Message (%s)");
col_add_str(pinfo->cinfo, COL_INFO, msg_type);
@@ -287,7 +287,7 @@ dissect_fix_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
continue;
}
- tag_str = tvb_get_ephemeral_string(tvb, field_offset, tag->tag_len);
+ tag_str = tvb_get_string(wmem_packet_scope(), tvb, field_offset, tag->tag_len);
tag_value = atoi(tag_str);
if (tag->value_len < 1) {
proto_tree *field_tree;
@@ -311,7 +311,7 @@ dissect_fix_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
found = 1;
}
- value = tvb_get_ephemeral_string(tvb, tag->value_offset, tag->value_len);
+ value = tvb_get_string(wmem_packet_scope(), tvb, tag->value_offset, tag->value_len);
if (found) {
if (fix_fields[i].table) {
if (tree) {
diff --git a/epan/dissectors/packet-fmtp.c b/epan/dissectors/packet-fmtp.c
index 8e0701f5ac..2d9e046924 100644
--- a/epan/dissectors/packet-fmtp.c
+++ b/epan/dissectors/packet-fmtp.c
@@ -94,15 +94,15 @@ dissect_fmtp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case FMTP_TYP_IDENTIFICATION:
proto_item_append_text(ti, " (%s)",
- tvb_get_ephemeral_string(tvb, FMTP_HEADER_LEN, packet_len-FMTP_HEADER_LEN));
+ tvb_get_string(wmem_packet_scope(), tvb, FMTP_HEADER_LEN, packet_len-FMTP_HEADER_LEN));
col_add_fstr(pinfo->cinfo, COL_INFO, "%s (%s)",
val_to_str(packet_type, packet_type_names, "Unknown (0x%02x)"),
- tvb_get_ephemeral_string(tvb, FMTP_HEADER_LEN, packet_len-FMTP_HEADER_LEN));
+ tvb_get_string(wmem_packet_scope(), tvb, FMTP_HEADER_LEN, packet_len-FMTP_HEADER_LEN));
break;
case FMTP_TYP_SYSTEM:
proto_item_append_text(ti, " (%s)",
- tvb_get_ephemeral_string(tvb, FMTP_HEADER_LEN, packet_len-FMTP_HEADER_LEN));
+ tvb_get_string(wmem_packet_scope(), tvb, FMTP_HEADER_LEN, packet_len-FMTP_HEADER_LEN));
col_add_fstr(pinfo->cinfo, COL_INFO, "%s (%s)",
val_to_str(packet_type, packet_type_names, "Unknown (0x%02x)"),
val_to_str(tvb_get_ntohs(tvb, FMTP_HEADER_LEN), system_message_names, "Unknown (0x%02x)"));
diff --git a/epan/dissectors/packet-foundry.c b/epan/dissectors/packet-foundry.c
index ede958c377..5c4eb3f8f9 100644
--- a/epan/dissectors/packet-foundry.c
+++ b/epan/dissectors/packet-foundry.c
@@ -148,7 +148,7 @@ dissect_string_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, pr
offset += 4;
length -= 4;
- string_value = tvb_get_ephemeral_string(tvb, offset, length);
+ string_value = tvb_get_string(wmem_packet_scope(), tvb, offset, length);
proto_item_append_text(string_item, ": \"%s\"",
format_text(string_value, strlen(string_value)));
diff --git a/epan/dissectors/packet-gadu-gadu.c b/epan/dissectors/packet-gadu-gadu.c
index 51fda43da3..6f39d0e7fc 100644
--- a/epan/dissectors/packet-gadu-gadu.c
+++ b/epan/dissectors/packet-gadu-gadu.c
@@ -647,7 +647,7 @@ dissect_gadu_gadu_uint32_string_utf8(tvbuff_t *tvb, const header_field_info *hfi
/* proto_tree_add_item(tree, hfindex, tvb, offset, len, ENC_UTF_8|ENC_NA); */
/* Use workaround */
- str = tvb_get_ephemeral_string_enc(tvb, offset, len, ENC_UTF_8|ENC_NA);
+ str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len, ENC_UTF_8|ENC_NA);
} else
str = "";
@@ -923,7 +923,7 @@ dissect_gadu_gadu_user_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
name_size = tvb_get_letohl(tvb, offset);
offset += 4;
- name = tvb_get_ephemeral_string_enc(tvb, offset, name_size, ENC_ASCII | ENC_NA);
+ name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, name_size, ENC_ASCII | ENC_NA);
proto_tree_add_string(tree, &hfi_gadu_gadu_userdata_attr_name, tvb, offset - 4, 4 + name_size, name);
offset += name_size;
/* type */
@@ -933,7 +933,7 @@ dissect_gadu_gadu_user_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
val_size = tvb_get_letohl(tvb, offset);
offset += 4;
- val = tvb_get_ephemeral_string_enc(tvb, offset, val_size, ENC_ASCII | ENC_NA);
+ val = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, val_size, ENC_ASCII | ENC_NA);
proto_tree_add_string(tree, &hfi_gadu_gadu_userdata_attr_value, tvb, offset - 4, 4 + val_size, val);
offset += val_size;
}
@@ -1342,7 +1342,7 @@ dissect_gadu_gadu_notify105_common(tvbuff_t *tvb, proto_tree *tree, int offset,
uin_len = tvb_get_guint8(tvb, offset);
offset += 1;
- uin = tvb_get_ephemeral_string_enc(tvb, offset, uin_len, ENC_ASCII | ENC_NA);
+ uin = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, uin_len, ENC_ASCII | ENC_NA);
proto_tree_add_string(tree, &hfi_gadu_gadu_contact_uin_str, tvb, offset - 1, 1 + uin_len, uin);
offset += uin_len;
if (puin)
diff --git a/epan/dissectors/packet-gearman.c b/epan/dissectors/packet-gearman.c
index 8677ec8b14..4e482dd17e 100644
--- a/epan/dissectors/packet-gearman.c
+++ b/epan/dissectors/packet-gearman.c
@@ -190,7 +190,7 @@ dissect_binary_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Gearman");
col_clear(pinfo->cinfo,COL_INFO);
- magic_code = tvb_get_ephemeral_string(tvb, 1, 3);
+ magic_code = tvb_get_string(wmem_packet_scope(), tvb, 1, 3);
type = tvb_get_ntohl(tvb, 4);
size = tvb_get_ntohl(tvb, 8);
@@ -440,7 +440,7 @@ dissect_management_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (cmdlen == linelen && 0 == tvb_strneql(tvb, offset, GEARMAN_MGR_CMDS[i], cmdlen))
{
proto_tree_add_item(gearman_tree, hf_gearman_mgr_cmd, tvb, offset, cmdlen, ENC_ASCII|ENC_NA);
- col_add_fstr(pinfo->cinfo, COL_INFO, "[MGR] %s", tvb_get_ephemeral_string(tvb, offset, linelen));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "[MGR] %s", tvb_get_string(wmem_packet_scope(), tvb, offset, linelen));
type = 1;
break;
}
@@ -453,12 +453,12 @@ dissect_management_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (type == 0)
{
- col_add_fstr(pinfo->cinfo, COL_INFO, "[MGR] %s", tvb_get_ephemeral_string(tvb, offset, linelen));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "[MGR] %s", tvb_get_string(wmem_packet_scope(), tvb, offset, linelen));
type = -1;
}
else
{
- col_append_sep_fstr(pinfo->cinfo, COL_INFO, ",", "%s", tvb_get_ephemeral_string(tvb, offset, linelen));
+ col_append_sep_fstr(pinfo->cinfo, COL_INFO, ",", "%s", tvb_get_string(wmem_packet_scope(), tvb, offset, linelen));
}
}
diff --git a/epan/dissectors/packet-git.c b/epan/dissectors/packet-git.c
index a48d1c2482..9b637b9e7a 100644
--- a/epan/dissectors/packet-git.c
+++ b/epan/dissectors/packet-git.c
@@ -55,7 +55,7 @@ static gboolean tvb_get_packet_length(tvbuff_t *tvb, int offset,
{
guint8 *lenstr;
- lenstr = tvb_get_ephemeral_string(tvb, offset, 4);
+ lenstr = tvb_get_string(wmem_packet_scope(), tvb, offset, 4);
return (sscanf(lenstr, "%hx", length) == 1);
}
diff --git a/epan/dissectors/packet-glusterfs.c b/epan/dissectors/packet-glusterfs.c
index c4f7bec30a..f5624c804f 100644
--- a/epan/dissectors/packet-glusterfs.c
+++ b/epan/dissectors/packet-glusterfs.c
@@ -552,7 +552,7 @@ gluster_rpc_dissect_dict(proto_tree *tree, tvbuff_t *tvb, int hfindex, int offse
tvb_get_letohl(tvb, offset + 4),
tvb_get_letohl(tvb, offset + 8));
} else {
- value = tvb_get_ephemeral_string(tvb, offset, value_len);
+ value = tvb_get_string(wmem_packet_scope(), tvb, offset, value_len);
proto_item_append_text(dict_item, "%s", value);
}
}
diff --git a/epan/dissectors/packet-gopher.c b/epan/dissectors/packet-gopher.c
index fbc0700bab..3b99e12df3 100644
--- a/epan/dissectors/packet-gopher.c
+++ b/epan/dissectors/packet-gopher.c
@@ -147,7 +147,7 @@ dissect_gopher(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
if (line_len == 0) {
request = "[Directory list]";
} else if (line_len > 0) {
- request = tvb_get_ephemeral_string(tvb, 0, line_len);
+ request = tvb_get_string(wmem_packet_scope(), tvb, 0, line_len);
}
col_add_fstr(pinfo->cinfo, COL_INFO, "Request: %s", request);
} else {
@@ -172,7 +172,7 @@ dissect_gopher(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
col_append_fstr(pinfo->cinfo, COL_INFO, ": [Directory list]");
}
- name = tvb_get_ephemeral_string(tvb, offset + 1, sel_start - offset - 2);
+ name = tvb_get_string(wmem_packet_scope(), tvb, offset + 1, sel_start - offset - 2);
ti = proto_tree_add_string(gopher_tree, hf_gopher_dir_item, tvb,
offset, line_len + 1, name);
dir_tree = proto_item_add_subtree(ti, ett_dir_item);
diff --git a/epan/dissectors/packet-gprscdr.c b/epan/dissectors/packet-gprscdr.c
index eea8f13534..cb53639504 100644
--- a/epan/dissectors/packet-gprscdr.c
+++ b/epan/dissectors/packet-gprscdr.c
@@ -1102,15 +1102,15 @@ dissect_gprscdr_TimeStamp(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs
return offset;
proto_item_append_text(actx->created_item, " (UTC %x-%x-%x %x:%x:%x %s%x:%x)",
- tvb_get_guint8(parameter_tvb,0), /* Year */
- tvb_get_guint8(parameter_tvb,1), /* Month */
- tvb_get_guint8(parameter_tvb,2), /* Day */
- tvb_get_guint8(parameter_tvb,3), /* Hour */
- tvb_get_guint8(parameter_tvb,4), /* Minute */
- tvb_get_guint8(parameter_tvb,5), /* Second */
- tvb_get_ephemeral_string(parameter_tvb,6,1), /* Sign */
- tvb_get_guint8(parameter_tvb,7), /* Hour */
- tvb_get_guint8(parameter_tvb,8) /* Minute */
+ tvb_get_guint8(parameter_tvb,0), /* Year */
+ tvb_get_guint8(parameter_tvb,1), /* Month */
+ tvb_get_guint8(parameter_tvb,2), /* Day */
+ tvb_get_guint8(parameter_tvb,3), /* Hour */
+ tvb_get_guint8(parameter_tvb,4), /* Minute */
+ tvb_get_guint8(parameter_tvb,5), /* Second */
+ tvb_get_string(wmem_packet_scope(), parameter_tvb,6,1), /* Sign */
+ tvb_get_guint8(parameter_tvb,7), /* Hour */
+ tvb_get_guint8(parameter_tvb,8) /* Minute */
);
diff --git a/epan/dissectors/packet-gsm_a_common.c b/epan/dissectors/packet-gsm_a_common.c
index 6dee54836e..b38f563a12 100644
--- a/epan/dissectors/packet-gsm_a_common.c
+++ b/epan/dissectors/packet-gsm_a_common.c
@@ -2286,7 +2286,7 @@ de_mid(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guin
a_bigbuf[0] = Dgt1_9_bcd.out[(oct & 0xf0) >> 4];
curr_offset++;
- poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
+ poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, len - (curr_offset - offset));
my_dgt_tbcd_unpack(&a_bigbuf[1], poctets, len - (curr_offset - offset),
&Dgt1_9_bcd);
diff --git a/epan/dissectors/packet-gsm_a_dtap.c b/epan/dissectors/packet-gsm_a_dtap.c
index b41e5c5fb8..b139a186fc 100644
--- a/epan/dissectors/packet-gsm_a_dtap.c
+++ b/epan/dissectors/packet-gsm_a_dtap.c
@@ -774,7 +774,7 @@ de_network_name(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off
}
else
{
- net_name = tvb_get_ephemeral_unicode_string(tvb, curr_offset, (len - 1), ENC_BIG_ENDIAN);
+ net_name = tvb_get_unicode_string(wmem_packet_scope(), tvb, curr_offset, (len - 1), ENC_BIG_ENDIAN);
proto_tree_add_text(tree, tvb, curr_offset, len - 1, "Text String: %s", net_name);
}
break;
@@ -1067,7 +1067,7 @@ de_emerg_num_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 o
curr_offset++;
en_len--;
- poctets = tvb_get_ephemeral_string(tvb, curr_offset, en_len);
+ poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, en_len);
my_dgt_tbcd_unpack(a_bigbuf, poctets, en_len, &Dgt_mbcd);
@@ -2511,7 +2511,7 @@ de_bcd_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset,
NO_MORE_DATA_CHECK(len);
num_string_len = len - (curr_offset - offset);
- poctets = tvb_get_ephemeral_string(tvb, curr_offset, num_string_len);
+ poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, num_string_len);
*address_extracted = TRUE;
my_dgt_tbcd_unpack(a_bigbuf, poctets, num_string_len,
@@ -2592,7 +2592,7 @@ de_sub_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset,
if (afi == 0x50)
{
ia5_string_len = len - (curr_offset - offset);
- ia5_string = tvb_get_ephemeral_string(tvb, curr_offset, ia5_string_len);
+ ia5_string = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, ia5_string_len);
invalid_ia5_char = FALSE;
for(i = 0; i < ia5_string_len; i++)
diff --git a/epan/dissectors/packet-gsm_map.c b/epan/dissectors/packet-gsm_map.c
index 8f0b793646..87c1d9aae7 100644
--- a/epan/dissectors/packet-gsm_map.c
+++ b/epan/dissectors/packet-gsm_map.c
@@ -4722,7 +4722,7 @@ dissect_gsm_map_ss_USSD_String(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
proto_tree_add_text(tree, parameter_tvb, 0, length, "USSD String: %s", utf8_text);
break;
case SMS_ENCODING_8BIT:
- proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %s", tvb_get_ephemeral_string(parameter_tvb, 0, length));
+ proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %s", tvb_get_string(wmem_packet_scope(), parameter_tvb, 0, length));
break;
case SMS_ENCODING_UCS2:
case SMS_ENCODING_UCS2_LANG:
@@ -8321,7 +8321,7 @@ dissect_gsm_map_ms_APN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
length = tvb_length(parameter_tvb);
name_len = tvb_get_guint8(parameter_tvb, 0);
- apn_str = tvb_get_ephemeral_string(parameter_tvb, 1, length - 1);
+ apn_str = tvb_get_string(wmem_packet_scope(), parameter_tvb, 1, length - 1);
if (name_len < length-1) {
for (;;) {
if (name_len >= length - 1)
diff --git a/epan/dissectors/packet-gsm_sms.c b/epan/dissectors/packet-gsm_sms.c
index 4c36cc834f..1051096826 100644
--- a/epan/dissectors/packet-gsm_sms.c
+++ b/epan/dissectors/packet-gsm_sms.c
@@ -2791,7 +2791,7 @@ dis_field_ud(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset
}
else if (ucs2)
{
- /* XXX, use tvb_get_ephemeral_unicode_string(.., ENC_BIG_ENDIAN); */
+ /* XXX, use tvb_get_unicode_string(.., ENC_BIG_ENDIAN); */
if ((cd = g_iconv_open("UTF-8","UCS-2BE")) != (GIConv)-1)
{
guint8 rep_len = tvb_reported_length(sm_tvb);
@@ -2853,7 +2853,7 @@ dis_field_ud(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset
g_free(utf8_text);
g_iconv_close(cd);
} else {
- ustr = tvb_get_ephemeral_unicode_string(tvb, offset, length, ENC_BIG_ENDIAN);
+ ustr = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, length, ENC_BIG_ENDIAN);
proto_tree_add_text(subtree, tvb, offset, length, "%s", ustr);
}
}
diff --git a/epan/dissectors/packet-gtp.c b/epan/dissectors/packet-gtp.c
index 076bbcdc57..7f2b4f8390 100644
--- a/epan/dissectors/packet-gtp.c
+++ b/epan/dissectors/packet-gtp.c
@@ -4603,7 +4603,7 @@ static const gchar *
dissect_radius_qos_umts(proto_tree * tree, tvbuff_t * tvb, packet_info* pinfo _U_)
{
decode_qos_umts(tvb, 0, tree, "UMTS GTP QoS Profile", 3);
- return tvb_get_ephemeral_string(tvb, 0, tvb_length(tvb));
+ return tvb_get_string(wmem_packet_scope(), tvb, 0, tvb_length(tvb));
}
#define MAX_APN_LENGTH 100
@@ -4644,7 +4644,7 @@ decode_fqdn(tvbuff_t * tvb, int offset, guint16 length, proto_tree * tree)
name_len = tvb_get_guint8(tvb, offset);
if (name_len < 0x20) {
- fqdn = tvb_get_ephemeral_string(tvb, offset + 1, length - 1);
+ fqdn = tvb_get_string(wmem_packet_scope(), tvb, offset + 1, length - 1);
for (;;) {
if (name_len >= length - 1)
break;
@@ -4653,7 +4653,7 @@ decode_fqdn(tvbuff_t * tvb, int offset, guint16 length, proto_tree * tree)
fqdn[tmp] = '.';
}
} else
- fqdn = tvb_get_ephemeral_string(tvb, offset, length);
+ fqdn = tvb_get_string(wmem_packet_scope(), tvb, offset, length);
proto_tree_add_string(tree, hf_gtp_fqdn, tvb, offset, length, fqdn);
}
diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c
index 4e759cf126..814fdad659 100644
--- a/epan/dissectors/packet-gtpv2.c
+++ b/epan/dissectors/packet-gtpv2.c
@@ -1449,7 +1449,7 @@ dissect_gtpv2_apn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto
name_len = tvb_get_guint8(tvb, offset);
if (name_len < 0x20) {
- apn = tvb_get_ephemeral_string(tvb, offset + 1, length - 1);
+ apn = tvb_get_string(wmem_packet_scope(), tvb, offset + 1, length - 1);
for (;;) {
if (name_len >= length - 1)
break;
@@ -1458,7 +1458,7 @@ dissect_gtpv2_apn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto
apn[tmp] = '.';
}
} else{
- apn = tvb_get_ephemeral_string(tvb, offset, length);
+ apn = tvb_get_string(wmem_packet_scope(), tvb, offset, length);
}
proto_tree_add_string(tree, hf_gtpv2_apn, tvb, offset, length, apn);
}
@@ -4416,7 +4416,7 @@ dissect_gtpv2_fqdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, prot
name_len = tvb_get_guint8(tvb, offset);
if (name_len < 0x20) {
- fqdn = tvb_get_ephemeral_string(tvb, offset + 1, length - 1);
+ fqdn = tvb_get_string(wmem_packet_scope(), tvb, offset + 1, length - 1);
for (;;) {
if (name_len >= length - 1)
break;
@@ -4425,7 +4425,7 @@ dissect_gtpv2_fqdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, prot
fqdn[tmp] = '.';
}
} else {
- fqdn = tvb_get_ephemeral_string(tvb, offset, length);
+ fqdn = tvb_get_string(wmem_packet_scope(), tvb, offset, length);
}
proto_tree_add_string(tree, hf_gtpv2_fqdn, tvb, offset, length, fqdn);
proto_item_append_text(item, "%s", fqdn);
diff --git a/epan/dissectors/packet-h248.c b/epan/dissectors/packet-h248.c
index c1fddbf160..7872e85139 100644
--- a/epan/dissectors/packet-h248.c
+++ b/epan/dissectors/packet-h248.c
@@ -2230,7 +2230,7 @@ dissect_h248_T_terminationId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
curr_info.term->type = 0; /* unknown */
if (curr_info.term->len) {
- curr_info.term->buffer = (guint8 *)ep_tvb_memdup(new_tvb,0,curr_info.term->len);
+ curr_info.term->buffer = (guint8 *)tvb_memdup(wmem_packet_scope(),new_tvb,0,curr_info.term->len);
curr_info.term->str = bytes_to_str(curr_info.term->buffer,curr_info.term->len);
}
diff --git a/epan/dissectors/packet-hip.c b/epan/dissectors/packet-hip.c
index 33088cf2c2..baf96798c5 100644
--- a/epan/dissectors/packet-hip.c
+++ b/epan/dissectors/packet-hip.c
@@ -1022,11 +1022,11 @@ dissect_hip_tlv(tvbuff_t *tvb, int offset, proto_item *ti, int type, int tlv_len
if (di_type == 1) {
/* RFC 1035 */
proto_tree_add_text(t, tvb, offset+16+hi_len, di_len,
- "FQDN: %s", tvb_get_ephemeral_string (tvb, offset+16+hi_len, di_len));
+ "FQDN: %s", tvb_get_string (wmem_packet_scope(), tvb, offset+16+hi_len, di_len));
} else if (di_type == 2) {
/* RFC 4282 */
proto_tree_add_text(t, tvb, offset+16+hi_len, di_len,
- "NAI: %s", tvb_get_ephemeral_string (tvb, offset+16+hi_len, di_len));
+ "NAI: %s", tvb_get_string (wmem_packet_scope(), tvb, offset+16+hi_len, di_len));
}
break;
case PARAM_CERT: /* CERT */
diff --git a/epan/dissectors/packet-hpfeeds.c b/epan/dissectors/packet-hpfeeds.c
index c238db4a2f..22acc381ca 100644
--- a/epan/dissectors/packet-hpfeeds.c
+++ b/epan/dissectors/packet-hpfeeds.c
@@ -135,7 +135,7 @@ dissect_hpfeeds_info_pdu(tvbuff_t *tvb, proto_tree *tree, guint offset)
len = tvb_get_guint8(tvb, offset);
/* don't move the offset yet as we need to get data after this operation */
- strptr = tvb_get_ephemeral_string(tvb, offset + 1, len);
+ strptr = tvb_get_string(wmem_packet_scope(), tvb, offset + 1, len);
ti = proto_tree_add_text(tree, tvb, offset, -1, "Broker: %s", strptr);
data_subtree = proto_item_add_subtree(ti, ett_hpfeeds);
@@ -192,7 +192,7 @@ dissect_hpfeeds_publish_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* get the channel name as ephemeral string just to make an attempt
* in order to decode more payload if channel is "well known"
*/
- strptr = tvb_get_ephemeral_string(tvb, offset, len);
+ strptr = tvb_get_string(wmem_packet_scope(), tvb, offset, len);
proto_tree_add_item(tree, hf_hpfeeds_channel, tvb, offset, len,
ENC_BIG_ENDIAN);
offset += len;
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index 43ae9fd24d..743cadf2f3 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -1504,7 +1504,7 @@ basic_request_dissector(tvbuff_t *tvb, proto_tree *tree, int offset,
tokenlen = get_token_len(line, lineend, &next_token);
/* Save the request URI for various later uses */
- request_uri = tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ request_uri = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
stat_info->request_uri = wmem_strdup(wmem_packet_scope(), request_uri);
conv_data->request_uri = wmem_strdup(wmem_file_scope(), request_uri);
@@ -1624,7 +1624,7 @@ chunked_encoding_dissector(tvbuff_t **tvb_ptr, packet_info *pinfo,
break;
}
- chunk_string = tvb_get_ephemeral_string(tvb, offset, linelen);
+ chunk_string = tvb_get_string(wmem_packet_scope(), tvb, offset, linelen);
if (chunk_string == NULL) {
/* Can't get the chunk size line */
@@ -1816,7 +1816,7 @@ chunked_encoding_dissector(tvbuff_t **tvb_ptr, packet_info *pinfo,
break;
}
- chunk_string = tvb_get_ephemeral_string(tvb, offset, linelen);
+ chunk_string = tvb_get_string(wmem_packet_scope(), tvb, offset, linelen);
if (chunk_string == NULL) {
/* Can't get the chunk size line */
diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c
index 7bc3591510..4dec4e67a5 100644
--- a/epan/dissectors/packet-iax2.c
+++ b/epan/dissectors/packet-iax2.c
@@ -1452,7 +1452,7 @@ static guint32 dissect_ies(tvbuff_t *tvb, packet_info *pinfo, guint32 offset,
break;
default:
- ptr = tvb_get_ephemeral_string(tvb, offset + 2, ies_len);
+ ptr = tvb_get_string(wmem_packet_scope(), tvb, offset + 2, ies_len);
ie_item =
proto_tree_add_string_format(ies_tree, hf_IAX_IE_UNKNOWN_BYTES,
tvb, offset+2, ies_len, ptr,
diff --git a/epan/dissectors/packet-icep.c b/epan/dissectors/packet-icep.c
index 009af1ccc8..d7dcf55651 100644
--- a/epan/dissectors/packet-icep.c
+++ b/epan/dissectors/packet-icep.c
@@ -241,7 +241,7 @@ static void dissect_ice_string(packet_info *pinfo, proto_tree *tree, proto_item
if ( Size != 0 ) {
- s = tvb_get_ephemeral_string(tvb, offset, Size);
+ s = tvb_get_string(wmem_packet_scope(), tvb, offset, Size);
proto_tree_add_string(tree, hf_icep, tvb, offset, Size, s);
} else {
s = wmem_strdup(wmem_packet_scope(), "(empty)");
diff --git a/epan/dissectors/packet-icp.c b/epan/dissectors/packet-icp.c
index 7e316d69ed..0d1d6c56bc 100644
--- a/epan/dissectors/packet-icp.c
+++ b/epan/dissectors/packet-icp.c
@@ -97,7 +97,7 @@ static void dissect_icp_payload(tvbuff_t *tvb, int offset,
/* null terminated URL */
stringlength = tvb_strsize(tvb, offset);
proto_tree_add_text(pload_tree, tvb, offset, stringlength,
- "URL: %s", tvb_get_ephemeral_string(tvb, offset, stringlength));
+ "URL: %s", tvb_get_string(wmem_packet_scope(), tvb, offset, stringlength));
break;
case CODE_ICP_OP_SECHO:
@@ -109,14 +109,14 @@ static void dissect_icp_payload(tvbuff_t *tvb, int offset,
case CODE_ICP_OP_DENIED:
stringlength = tvb_strsize(tvb, offset);
proto_tree_add_text(pload_tree, tvb, offset, stringlength,
- "URL: %s", tvb_get_ephemeral_string(tvb, offset, stringlength));
+ "URL: %s", tvb_get_string(wmem_packet_scope(), tvb, offset, stringlength));
break;
case CODE_ICP_OP_HIT_OBJ:
/* null terminated URL */
stringlength = tvb_strsize(tvb, offset);
proto_tree_add_text(pload_tree, tvb, offset, stringlength,
- "URL: %s", tvb_get_ephemeral_string(tvb, offset, stringlength));
+ "URL: %s", tvb_get_string(wmem_packet_scope(), tvb, offset, stringlength));
offset += stringlength;
/* 2 byte object size */
diff --git a/epan/dissectors/packet-icq.c b/epan/dissectors/packet-icq.c
index e992b1af0d..5b88b27d2c 100644
--- a/epan/dissectors/packet-icq.c
+++ b/epan/dissectors/packet-icq.c
@@ -442,7 +442,7 @@ proto_add_icq_attr(proto_tree* tree, /* The tree to add to */
return -1; /* length goes past end of packet */
proto_tree_add_text(tree, tvb, offset, len+2,
"%s[%u]: %.*s", descr, len, len,
- tvb_get_ephemeral_string(tvb, offset + 2, len));
+ tvb_get_string(wmem_packet_scope(), tvb, offset + 2, len));
return len + 2;
}
@@ -516,7 +516,7 @@ icqv5_decode_msgType(proto_tree* tree, tvbuff_t *tvb, int offset, int size,
break;
case MSG_TEXT:
proto_tree_add_text(subtree, tvb, offset, left, "Msg: %.*s", left-1,
- tvb_get_ephemeral_string(tvb, offset, left));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, left));
break;
case MSG_URL:
for (n = 0; n < N_URL_FIELDS; n++) {
@@ -530,7 +530,7 @@ icqv5_decode_msgType(proto_tree* tree, tvbuff_t *tvb, int offset, int size,
proto_tree_add_text(subtree, tvb, offset, sz, "%s: %.*s",
url_field_descr[n],
sz - 1,
- tvb_get_ephemeral_string(tvb, offset, sz));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, sz));
} else {
proto_tree_add_text(subtree, tvb, offset, 0,
"%s: %s", url_field_descr[n], "(empty)");
@@ -551,7 +551,7 @@ icqv5_decode_msgType(proto_tree* tree, tvbuff_t *tvb, int offset, int size,
proto_tree_add_text(subtree, tvb, offset, sz, "%s: %.*s",
email_field_descr[n],
sz - 1,
- tvb_get_ephemeral_string(tvb, offset, sz));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, sz));
} else {
proto_tree_add_text(subtree, tvb, offset, 0, "%s: %s",
email_field_descr[n], "(empty)");
@@ -586,7 +586,7 @@ icqv5_decode_msgType(proto_tree* tree, tvbuff_t *tvb, int offset, int size,
if (sz != 0) {
proto_tree_add_text(subtree, tvb, offset, sz, "%s: %.*s",
auth_req_field_descr[n], sz - 1,
- tvb_get_ephemeral_string(tvb, offset, sz));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, sz));
} else {
proto_tree_add_text(subtree, tvb, offset, 0, "%s: %s",
auth_req_field_descr[n], "(empty)");
@@ -606,7 +606,7 @@ icqv5_decode_msgType(proto_tree* tree, tvbuff_t *tvb, int offset, int size,
if (sz != 0) {
proto_tree_add_text(subtree, tvb, offset, sz, "%s: %.*s",
user_added_field_descr[n], sz - 1,
- tvb_get_ephemeral_string(tvb, offset, sz));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, sz));
} else {
proto_tree_add_text(subtree, tvb, offset, 0, "%s: %s",
user_added_field_descr[n], "(empty)");
@@ -636,7 +636,7 @@ icqv5_decode_msgType(proto_tree* tree, tvbuff_t *tvb, int offset, int size,
/* The first element is the number of Nick/UIN pairs follow */
proto_tree_add_text(subtree, tvb, offset, sz_local,
"Number of pairs: %.*s", sz_local - 1,
- tvb_get_ephemeral_string(tvb, offset, sz_local));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, sz_local));
n_local++;
} else if (!last) {
int svsz = sz_local;
@@ -652,8 +652,8 @@ icqv5_decode_msgType(proto_tree* tree, tvbuff_t *tvb, int offset, int size,
}
proto_tree_add_text(subtree, tvb, offset, sz_local + svsz,
"%.*s: %.*s", svsz - 1,
- tvb_get_ephemeral_string(tvb, offset, svsz), sz_local - 1,
- tvb_get_ephemeral_string(tvb, sep_offset_prev + 1, sz_local));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, svsz), sz_local - 1,
+ tvb_get_string(wmem_packet_scope(), tvb, sep_offset_prev + 1, sz_local));
n_local += 2;
}
@@ -686,7 +686,7 @@ icqv5_cmd_send_text_code(proto_tree* tree, /* Tree to put the data in */
if (len>0) {
proto_tree_add_text(subtree, tvb, offset + CMD_SEND_TEXT_CODE_TEXT,
len, "Text: %.*s", len,
- tvb_get_ephemeral_string(tvb, offset + CMD_SEND_TEXT_CODE_TEXT,
+ tvb_get_string(wmem_packet_scope(), tvb, offset + CMD_SEND_TEXT_CODE_TEXT,
len));
}
@@ -729,7 +729,7 @@ icqv5_cmd_login(proto_tree* tree, tvbuff_t *tvb, int offset)
passwdLen = tvb_get_letohs(tvb, offset + CMD_LOGIN_PASSLEN);
proto_tree_add_text(subtree, tvb, offset + CMD_LOGIN_PASSLEN,
2 + passwdLen, "Passwd: %.*s", (int)passwdLen,
- tvb_get_ephemeral_string(tvb, offset + CMD_LOGIN_PASSWD,
+ tvb_get_string(wmem_packet_scope(), tvb, offset + CMD_LOGIN_PASSWD,
passwdLen));
proto_tree_add_text(subtree, tvb,
offset + CMD_LOGIN_PASSWD + passwdLen + CMD_LOGIN_IP,
@@ -914,7 +914,7 @@ icqv5_srv_meta_user(proto_tree* tree, /* Tree to put the data in */
offset+=2;
proto_tree_add_text(sstree, tvb, offset - 2,
len+2, "About(%d): %.*s", len,
- len, tvb_get_ephemeral_string(tvb, offset, len));
+ len, tvb_get_string(wmem_packet_scope(), tvb, offset, len));
break;
}
case META_USER_INFO:
@@ -1106,7 +1106,7 @@ dissect_icqv5Client(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* bytes in the buffer.
*/
rounded_size = ((((capturedsize - ICQ5_CL_SESSIONID) + 3)/4)*4) + ICQ5_CL_SESSIONID;
- /* rounded_size might exceed the tvb bounds so we can't just use tvb_g_memdup here. */
+ /* rounded_size might exceed the tvb bounds so we can't just use tvb_memdup here. */
decr_pd = (guint8 *)g_malloc(rounded_size);
tvb_memcpy(tvb, decr_pd, 0, capturedsize);
decrypt_v5(decr_pd, rounded_size, key);
diff --git a/epan/dissectors/packet-ieee80211-prism.c b/epan/dissectors/packet-ieee80211-prism.c
index 0060c5110d..3b7cc3fbd5 100644
--- a/epan/dissectors/packet-ieee80211-prism.c
+++ b/epan/dissectors/packet-ieee80211-prism.c
@@ -325,7 +325,7 @@ dissect_prism(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(tree) {
proto_tree_add_item(prism_tree, hf_ieee80211_prism_devname, tvb, offset, 16, ENC_ASCII|ENC_NA);
}
- devname_p = tvb_get_ephemeral_string(tvb, offset, 16);
+ devname_p = tvb_get_string(wmem_packet_scope(), tvb, offset, 16);
offset += 16;
col_add_fstr(pinfo->cinfo, COL_INFO, "Device: %s, Message 0x%x, Length %d", devname_p, msgcode, msglen);
diff --git a/epan/dissectors/packet-ieee80211-radiotap.c b/epan/dissectors/packet-ieee80211-radiotap.c
index ce7eb1306b..b3238ef42d 100644
--- a/epan/dissectors/packet-ieee80211-radiotap.c
+++ b/epan/dissectors/packet-ieee80211-radiotap.c
@@ -1028,7 +1028,7 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
tvb, 2, 2, length);
}
- data = ep_tvb_memdup(tvb, 0, length);
+ data = tvb_memdup(wmem_packet_scope(), tvb, 0, length);
if (!data)
return;
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index 3210eb3836..0e0c9993c6 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -5386,7 +5386,7 @@ dissect_nai_realm_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int
}
proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm,
tvb, offset, nai_len, ENC_ASCII|ENC_NA);
- realm = tvb_get_ephemeral_string(tvb, offset, nai_len);
+ realm = tvb_get_string(wmem_packet_scope(), tvb, offset, nai_len);
if (realm) {
proto_item_append_text(r_item, " (%s)", realm);
}
@@ -8429,7 +8429,7 @@ dissect_vendor_ie_aruba(proto_item *item, proto_tree *ietree,
proto_tree_add_item (ietree, hf_ieee80211_vs_aruba_apname, tvb,
offset, tag_len, ENC_ASCII|ENC_NA);
- proto_item_append_text(item, " (%s)", tvb_get_ephemeral_string(tvb, offset, tag_len));
+ proto_item_append_text(item, " (%s)", tvb_get_string(wmem_packet_scope(), tvb, offset, tag_len));
break;
default:
@@ -9232,7 +9232,7 @@ dissect_ssid_list(proto_tree *tree, tvbuff_t *tvb, int offset, guint32 tag_len)
if (offset + 2 + len > end)
break;
- str = tvb_get_ephemeral_string(tvb, offset + 2, len);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset + 2, len);
proto_item_append_text(tree, "%c %s", (first ? ':' : ','), str);
first = FALSE;
ssid = proto_tree_add_text(tree, tvb, offset, 2 + len, "SSID: %s", str);
@@ -10929,7 +10929,7 @@ ieee80211_tag_ssid(packet_info *pinfo, proto_tree *tree,
ssid_len = MAX_SSID_LEN;
}
- ssid = tvb_get_ephemeral_string(tvb, offset + 2, ssid_len);
+ ssid = tvb_get_string(wmem_packet_scope(), tvb, offset + 2, ssid_len);
if (ssid_len == (gint)tag_len) {
AirPDcapSetLastSSID(&airpdcap_ctx, (CHAR *) ssid, ssid_len);
}
@@ -11193,7 +11193,7 @@ ieee80211_tag_country_info(packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(tree, hf_ieee80211_tag_country_info_code,
tvb, offset, 2, ENC_ASCII|ENC_NA);
proto_item_append_text(ti, ": Country Code %s",
- tvb_get_ephemeral_string(tvb, offset, 2));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, 2));
offset += 2;
proto_tree_add_item(tree, hf_ieee80211_tag_country_info_env,
@@ -12655,8 +12655,8 @@ add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset
proto_tree_add_item(tree, hf_ieee80211_mesh_id, tvb, offset, tag_len, ENC_ASCII|ENC_NA);
if (tag_len > 0) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", MESHID=%s", tvb_get_ephemeral_string(tvb, offset, tag_len));
- proto_item_append_text(ti, ": %s", tvb_get_ephemeral_string(tvb, offset, tag_len));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", MESHID=%s", tvb_get_string(wmem_packet_scope(), tvb, offset, tag_len));
+ proto_item_append_text(ti, ": %s", tvb_get_string(wmem_packet_scope(), tvb, offset, tag_len));
}
break;
diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c
index df3c0d394c..132a49000a 100644
--- a/epan/dissectors/packet-ieee802154.c
+++ b/epan/dissectors/packet-ieee802154.c
@@ -1882,7 +1882,7 @@ dissect_ieee802154_decrypt(tvbuff_t * tvb, guint offset, packet_info * pinfo, ie
* We will decrypt the message in-place and then use the buffer as the
* real data for the new tvb.
*/
- text = (guint8 *)tvb_g_memdup(tvb, offset, captured_len);
+ text = (guint8 *)tvb_memdup(NULL, tvb, offset, captured_len);
/* Perform CTR-mode transformation. */
if (!ccm_ctr_encrypt(key, tmp, rx_mic, text, captured_len)) {
@@ -1940,7 +1940,7 @@ dissect_ieee802154_decrypt(tvbuff_t * tvb, guint offset, packet_info * pinfo, ie
* already points to contiguous memory, since we just allocated it in
* decryption phase.
*/
- if (!ccm_cbc_mac(key, tmp, (const gchar *)ep_tvb_memdup(tvb, 0, l_a), l_a, tvb_get_ptr(ptext_tvb, 0, l_m), l_m, dec_mic)) {
+ if (!ccm_cbc_mac(key, tmp, (const gchar *)tvb_memdup(wmem_packet_scope(), tvb, 0, l_a), l_a, tvb_get_ptr(ptext_tvb, 0, l_m), l_m, dec_mic)) {
*status = DECRYPT_PACKET_MIC_CHECK_FAILED;
}
/* Compare the received MIC with the one we generated. */
diff --git a/epan/dissectors/packet-image-gif.c b/epan/dissectors/packet-image-gif.c
index 7de1b92aa3..44de462d78 100644
--- a/epan/dissectors/packet-image-gif.c
+++ b/epan/dissectors/packet-image-gif.c
@@ -326,7 +326,7 @@ dissect_gif(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
if (tvb_len < 20)
return 0;
- str = tvb_get_ephemeral_string(tvb, 0, 6);
+ str = tvb_get_string(wmem_packet_scope(), tvb, 0, 6);
/* Check whether we're processing a GIF object */
/* see http://www.w3.org/Graphics/GIF/spec-gif89a.txt section 17 */
if (strcmp(str, "GIF87a") == 0) {
diff --git a/epan/dissectors/packet-imf.c b/epan/dissectors/packet-imf.c
index d27eca018b..96d085e6bd 100644
--- a/epan/dissectors/packet-imf.c
+++ b/epan/dissectors/packet-imf.c
@@ -541,7 +541,7 @@ dissect_imf_siolabel(tvbuff_t *tvb, int offset, int length, proto_item *item, pa
}
if (tvb_strneql(tvb, item_offset, "marking", 7) == 0) {
- proto_item_append_text(item, ": %s", tvb_get_ephemeral_string(tvb, value_offset, value_length));
+ proto_item_append_text(item, ": %s", tvb_get_string(wmem_packet_scope(), tvb, value_offset, value_length));
proto_tree_add_item(tree, hf_imf_siolabel_marking, tvb, value_offset, value_length, ENC_ASCII|ENC_NA);
} else if (tvb_strneql(tvb, item_offset, "fgcolor", 7) == 0) {
@@ -551,15 +551,15 @@ dissect_imf_siolabel(tvbuff_t *tvb, int offset, int length, proto_item *item, pa
proto_tree_add_item(tree, hf_imf_siolabel_bgcolor, tvb, value_offset, value_length, ENC_ASCII|ENC_NA);
} else if (tvb_strneql(tvb, item_offset, "type", 4) == 0) {
- type = tvb_get_ephemeral_string(tvb, value_offset + 1, value_length - 2); /* quoted */
+ type = tvb_get_string(wmem_packet_scope(), tvb, value_offset + 1, value_length - 2); /* quoted */
proto_tree_add_item(tree, hf_imf_siolabel_type, tvb, value_offset, value_length, ENC_ASCII|ENC_NA);
} else if (tvb_strneql(tvb, item_offset, "label", 5) == 0) {
- gchar *label = tvb_get_ephemeral_string(tvb, value_offset + 1, value_length - 2); /* quoted */
+ gchar *label = tvb_get_string(wmem_packet_scope(), tvb, value_offset + 1, value_length - 2); /* quoted */
wmem_strbuf_append(label_string, label);
if (tvb_get_guint8(tvb, item_offset + 5) == '*') { /* continuations */
- int num = (int)strtol(tvb_get_ephemeral_string(tvb, item_offset + 6, value_offset - item_offset + 6), NULL, 10);
+ int num = (int)strtol(tvb_get_string(wmem_packet_scope(), tvb, item_offset + 6, value_offset - item_offset + 6), NULL, 10);
proto_tree_add_string_format(tree, hf_imf_siolabel_label, tvb, value_offset, value_length,
label, "Label[%d]: \"%s\"", num, label);
} else {
@@ -616,13 +616,13 @@ dissect_imf_content_type(tvbuff_t *tvb, int offset, int length, proto_item *item
proto_tree_add_item(ct_tree, hf_imf_content_type_type, tvb, offset, len, ENC_ASCII|ENC_NA);
if(type) {
/* This string will be automatically freed */
- (*type) = tvb_get_ephemeral_string(tvb, offset, len);
+ (*type) = tvb_get_string(wmem_packet_scope(), tvb, offset, len);
}
len = tvb_find_line_end(tvb, first_colon + 1, length, NULL, FALSE);
proto_tree_add_item(ct_tree, hf_imf_content_type_parameters, tvb, first_colon + 1, len, ENC_ASCII|ENC_NA);
if(parameters) {
/* This string will be automatically freed */
- (*parameters) = tvb_get_ephemeral_string(tvb, first_colon + 1, len);
+ (*parameters) = tvb_get_string(wmem_packet_scope(), tvb, first_colon + 1, len);
}
}
}
@@ -714,7 +714,7 @@ dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* XXX: flag an error */
break;
} else {
- key = tvb_get_ephemeral_string(tvb, start_offset, end_offset - start_offset);
+ key = tvb_get_string(wmem_packet_scope(), tvb, start_offset, end_offset - start_offset);
/* convert to lower case */
ascii_strdown_inplace (key);
diff --git a/epan/dissectors/packet-ipp.c b/epan/dissectors/packet-ipp.c
index d83cbefcde..97b7cc0fb7 100644
--- a/epan/dissectors/packet-ipp.c
+++ b/epan/dissectors/packet-ipp.c
@@ -674,7 +674,7 @@ add_value_head(const gchar *tag_desc, proto_tree *tree, tvbuff_t *tvb,
offset += 2;
if (name_length != 0) {
guint8 *nv;
- nv = tvb_get_ephemeral_string(tvb, offset, name_length);
+ nv = tvb_get_string(wmem_packet_scope(), tvb, offset, name_length);
proto_tree_add_text(tree, tvb, offset, name_length,
"Name: %s", format_text(nv, name_length));
if (name_val) {
diff --git a/epan/dissectors/packet-irc.c b/epan/dissectors/packet-irc.c
index 7f5e25be46..49dcc204b9 100644
--- a/epan/dissectors/packet-irc.c
+++ b/epan/dissectors/packet-irc.c
@@ -166,7 +166,7 @@ dissect_irc_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int off
if (eoc_offset == -1)
{
proto_tree_add_item(request_tree, hf_irc_request_command, tvb, offset, end_offset-offset, ENC_ASCII|ENC_NA);
- col_append_fstr( pinfo->cinfo, COL_INFO, " (%s)", tvb_get_ephemeral_string(tvb, offset, end_offset-offset));
+ col_append_fstr( pinfo->cinfo, COL_INFO, " (%s)", tvb_get_string(wmem_packet_scope(), tvb, offset, end_offset-offset));
/* Warn if there is a "numeric" command */
if ((end_offset-offset == 3) &&
@@ -180,7 +180,7 @@ dissect_irc_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int off
}
proto_tree_add_item(request_tree, hf_irc_request_command, tvb, offset, eoc_offset-offset, ENC_ASCII|ENC_NA);
- str_command = tvb_get_ephemeral_string(tvb, offset, eoc_offset-offset);
+ str_command = tvb_get_string(wmem_packet_scope(), tvb, offset, eoc_offset-offset);
col_append_fstr( pinfo->cinfo, COL_INFO, " (%s)", str_command);
/* Warn if there is a "numeric" command */
@@ -334,7 +334,7 @@ dissect_irc_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int of
if (eoc_offset == -1)
{
proto_tree_add_item(response_tree, hf_irc_response_command, tvb, offset, end_offset-offset, ENC_ASCII|ENC_NA);
- col_append_fstr( pinfo->cinfo, COL_INFO, " (%s)", tvb_get_ephemeral_string(tvb, offset, end_offset-offset));
+ col_append_fstr( pinfo->cinfo, COL_INFO, " (%s)", tvb_get_string(wmem_packet_scope(), tvb, offset, end_offset-offset));
/* if response command is numeric, allow it to be filtered as an integer */
if ((end_offset-offset == 3) &&
@@ -350,7 +350,7 @@ dissect_irc_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int of
}
proto_tree_add_item(response_tree, hf_irc_response_command, tvb, offset, eoc_offset-offset, ENC_ASCII|ENC_NA);
- str_command = tvb_get_ephemeral_string(tvb, offset, eoc_offset-offset);
+ str_command = tvb_get_string(wmem_packet_scope(), tvb, offset, eoc_offset-offset);
col_append_fstr( pinfo->cinfo, COL_INFO, " (%s)", str_command);
/* if response command is numeric, allow it to be filtered as an integer */
diff --git a/epan/dissectors/packet-isakmp.c b/epan/dissectors/packet-isakmp.c
index c34136e6dc..b1bb8784ac 100644
--- a/epan/dissectors/packet-isakmp.c
+++ b/epan/dissectors/packet-isakmp.c
@@ -3691,11 +3691,11 @@ dissect_id(tvbuff_t *tvb, int offset, int length, proto_tree *tree, int isakmp_v
break;
case IKE_ID_FQDN:
proto_tree_add_item(idtree, hf_isakmp_id_data_fqdn, tvb, offset, length, ENC_ASCII|ENC_NA);
- proto_item_append_text(idit, "%s", tvb_get_ephemeral_string(tvb, offset,length));
+ proto_item_append_text(idit, "%s", tvb_get_string(wmem_packet_scope(), tvb, offset,length));
break;
case IKE_ID_USER_FQDN:
proto_tree_add_item(idtree, hf_isakmp_id_data_user_fqdn, tvb, offset, length, ENC_ASCII|ENC_NA);
- proto_item_append_text(idit, "%s", tvb_get_ephemeral_string(tvb, offset,length));
+ proto_item_append_text(idit, "%s", tvb_get_string(wmem_packet_scope(), tvb, offset,length));
break;
case IKE_ID_IPV4_ADDR_SUBNET:
proto_tree_add_item(idtree, hf_isakmp_id_data_ipv4_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
@@ -4234,7 +4234,7 @@ dissect_config_attribute(tvbuff_t *tvb, proto_tree *cfg_attr_type_tree, int offs
break;
case APPLICATION_VERSION: /* 7 */
proto_tree_add_item(sub_cfg_attr_type_tree, hf_isakmp_cfg_attr_application_version, tvb, offset, optlen, ENC_ASCII|ENC_NA);
- proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_ephemeral_string(tvb, offset,optlen));
+ proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_string(wmem_packet_scope(), tvb, offset,optlen));
break;
case INTERNAL_IP6_ADDRESS: /* 8 */
offset_end = offset + optlen;
@@ -4359,27 +4359,27 @@ dissect_config_attribute(tvbuff_t *tvb, proto_tree *cfg_attr_type_tree, int offs
break;
case XAUTH_USER_NAME: /* 16521 */
proto_tree_add_item(sub_cfg_attr_type_tree, hf_isakmp_cfg_attr_xauth_user_name, tvb, offset, optlen, ENC_ASCII|ENC_NA);
- proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_ephemeral_string(tvb, offset,optlen));
+ proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_string(wmem_packet_scope(), tvb, offset,optlen));
break;
case XAUTH_USER_PASSWORD: /* 16522 */
proto_tree_add_item(sub_cfg_attr_type_tree, hf_isakmp_cfg_attr_xauth_user_password, tvb, offset, optlen, ENC_ASCII|ENC_NA);
- proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_ephemeral_string(tvb, offset,optlen));
+ proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_string(wmem_packet_scope(), tvb, offset,optlen));
break;
case XAUTH_PASSCODE: /* 16523 */
proto_tree_add_item(sub_cfg_attr_type_tree, hf_isakmp_cfg_attr_xauth_passcode, tvb, offset, optlen, ENC_ASCII|ENC_NA);
- proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_ephemeral_string(tvb, offset,optlen));
+ proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_string(wmem_packet_scope(), tvb, offset,optlen));
break;
case XAUTH_MESSAGE: /* 16524 */
proto_tree_add_item(sub_cfg_attr_type_tree, hf_isakmp_cfg_attr_xauth_message, tvb, offset, optlen, ENC_ASCII|ENC_NA);
- proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_ephemeral_string(tvb, offset,optlen));
+ proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_string(wmem_packet_scope(), tvb, offset,optlen));
break;
case XAUTH_CHALLENGE: /* 16525 */
proto_tree_add_item(sub_cfg_attr_type_tree, hf_isakmp_cfg_attr_xauth_challenge, tvb, offset, optlen, ENC_ASCII|ENC_NA);
- proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_ephemeral_string(tvb, offset,optlen));
+ proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_string(wmem_packet_scope(), tvb, offset,optlen));
break;
case XAUTH_DOMAIN: /* 16526 */
proto_tree_add_item(sub_cfg_attr_type_tree, hf_isakmp_cfg_attr_xauth_domain, tvb, offset, optlen, ENC_ASCII|ENC_NA);
- proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_ephemeral_string(tvb, offset,optlen));
+ proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_string(wmem_packet_scope(), tvb, offset,optlen));
break;
case XAUTH_STATUS: /* 16527 */
proto_tree_add_item(sub_cfg_attr_type_tree, hf_isakmp_cfg_attr_xauth_status, tvb, offset, optlen, ENC_BIG_ENDIAN);
@@ -4387,20 +4387,20 @@ dissect_config_attribute(tvbuff_t *tvb, proto_tree *cfg_attr_type_tree, int offs
break;
case XAUTH_NEXT_PIN: /* 16528 */
proto_tree_add_item(sub_cfg_attr_type_tree, hf_isakmp_cfg_attr_xauth_next_pin, tvb, offset, optlen, ENC_ASCII|ENC_NA);
- proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_ephemeral_string(tvb, offset,optlen));
+ proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_string(wmem_packet_scope(), tvb, offset,optlen));
break;
case XAUTH_ANSWER: /* 16527 */
proto_tree_add_item(sub_cfg_attr_type_tree, hf_isakmp_cfg_attr_xauth_answer, tvb, offset, optlen, ENC_ASCII|ENC_NA);
- proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_ephemeral_string(tvb, offset,optlen));
+ proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_string(wmem_packet_scope(), tvb, offset,optlen));
break;
case UNITY_BANNER: /* 28672 */
proto_tree_add_item(sub_cfg_attr_type_tree, hf_isakmp_cfg_attr_unity_banner, tvb, offset, optlen, ENC_ASCII|ENC_NA);
- proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_ephemeral_string(tvb, offset,optlen));
+ proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_string(wmem_packet_scope(), tvb, offset,optlen));
break;
case UNITY_DEF_DOMAIN: /* 28674 */
proto_tree_add_item(sub_cfg_attr_type_tree, hf_isakmp_cfg_attr_unity_def_domain, tvb, offset, optlen, ENC_ASCII|ENC_NA);
- proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_ephemeral_string(tvb, offset,optlen));
+ proto_item_append_text(cfg_attr_type_item," : %s", tvb_get_string(wmem_packet_scope(), tvb, offset,optlen));
break;
/* TODO: Support other UNITY Attributes ! */
default:
@@ -4650,7 +4650,7 @@ dissect_enc(tvbuff_t *tvb,
if (iv_len) {
iv_item = proto_tree_add_item(tree, hf_isakmp_enc_iv, tvb, offset, iv_len, ENC_NA);
proto_item_append_text(iv_item, " (%d bytes)", iv_len);
- iv = (guchar *)ep_tvb_memdup(tvb, offset, iv_len);
+ iv = (guchar *)tvb_memdup(wmem_packet_scope(), tvb, offset, iv_len);
offset += iv_len;
}
@@ -4660,7 +4660,7 @@ dissect_enc(tvbuff_t *tvb,
*/
encr_data_item = proto_tree_add_item(tree, hf_isakmp_enc_data, tvb, offset, encr_data_len, ENC_NA);
proto_item_append_text(encr_data_item, " (%d bytes)",encr_data_len);
- encr_data = (guchar *)ep_tvb_memdup(tvb, offset, encr_data_len);
+ encr_data = (guchar *)tvb_memdup(wmem_packet_scope(), tvb, offset, encr_data_len);
offset += encr_data_len;
/*
@@ -4689,7 +4689,7 @@ dissect_enc(tvbuff_t *tvb,
}
/* Calculate hash over the bytes from the beginning of the ISAKMP header to the right before the ICD. */
- entire_message = (guchar *)ep_tvb_memdup(tvb, 0, offset);
+ entire_message = (guchar *)tvb_memdup(wmem_packet_scope(), tvb, 0, offset);
gcry_md_write(md_hd, entire_message, offset);
md = gcry_md_read(md_hd, 0);
md_len = gcry_md_get_algo_dlen(key_info->auth_spec->gcry_alg);
diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c
index 9136b25903..e66c762a72 100644
--- a/epan/dissectors/packet-iscsi.c
+++ b/epan/dissectors/packet-iscsi.c
@@ -606,7 +606,7 @@ addTextKeys(packet_info *pinfo, proto_tree *tt, tvbuff_t *tvb, gint offset, guin
len = len + 1;
}
- key = tvb_get_ephemeral_string(tvb, offset, len);
+ key = tvb_get_string(wmem_packet_scope(), tvb, offset, len);
if (key == NULL) {
break;
}
diff --git a/epan/dissectors/packet-isis-clv.c b/epan/dissectors/packet-isis-clv.c
index f22edaa9fe..4d401b3623 100644
--- a/epan/dissectors/packet-isis-clv.c
+++ b/epan/dissectors/packet-isis-clv.c
@@ -209,7 +209,7 @@ isis_dissect_ip_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
if ( length != 0 ) {
proto_tree_add_text ( tree, tvb, offset, length,
"IP Authentication: %.*s", length,
- tvb_get_ephemeral_string(tvb, offset, length) );
+ tvb_get_string(wmem_packet_scope(), tvb, offset, length) );
}
}
@@ -243,7 +243,7 @@ isis_dissect_hostname_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
proto_tree_add_text ( tree, tvb, offset, length,
"Hostname: --none--" );
} else {
- const char* value = tvb_get_ephemeral_string(tvb, offset, length);
+ const char* value = tvb_get_string(wmem_packet_scope(), tvb, offset, length);
proto_tree_add_string_format ( tree, tree_id,
tvb, offset, length,
value, "Hostname: %.*s", length, value);
diff --git a/epan/dissectors/packet-ismp.c b/epan/dissectors/packet-ismp.c
index 0fce351c6c..e86f6619d2 100644
--- a/epan/dissectors/packet-ismp.c
+++ b/epan/dissectors/packet-ismp.c
@@ -443,7 +443,7 @@ dissect_ismp_edp(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *ismp
proto_tree_add_text(edp_tuples_leaf_tree, tvb, offset, tuple_length,
"Interface IPX_address = %s",
ipx_addr_to_str(tvb_get_ntohl(tvb, offset),
- tvb_get_ephemeral_string(tvb, offset+4, tuple_length-4)));
+ tvb_get_string(wmem_packet_scope(), tvb, offset+4, tuple_length-4)));
break;
case EDP_TUPLE_UNKNOWN:
default:
diff --git a/epan/dissectors/packet-isup.c b/epan/dissectors/packet-isup.c
index 7c265a1cf3..02203cd291 100644
--- a/epan/dissectors/packet-isup.c
+++ b/epan/dissectors/packet-isup.c
@@ -6937,7 +6937,7 @@ dissect_isup_generic_name_parameter(tvbuff_t *parameter_tvb, proto_tree *paramet
proto_tree_add_uint(parameter_tree, hf_isup_generic_name_presentation, parameter_tvb, 1, 1, indicator);
proto_tree_add_boolean(parameter_tree, hf_isup_generic_name_availability, parameter_tvb, 1, 1, indicator);
proto_tree_add_uint(parameter_tree, hf_isup_generic_name_type, parameter_tvb, 1, 1, indicator);
- gen_name = tvb_get_ephemeral_string(parameter_tvb,1,gen_name_length);
+ gen_name = tvb_get_string(wmem_packet_scope(), parameter_tvb,1,gen_name_length);
gen_name[gen_name_length] = '\0';
proto_tree_add_string(parameter_tree, hf_isup_generic_name_ia5, parameter_tvb, 2, gen_name_length, gen_name);
proto_item_set_text(parameter_item, "Generic name: %s", gen_name);
diff --git a/epan/dissectors/packet-iua.c b/epan/dissectors/packet-iua.c
index dd88d8cc90..43e9245e17 100644
--- a/epan/dissectors/packet-iua.c
+++ b/epan/dissectors/packet-iua.c
@@ -138,7 +138,7 @@ dissect_text_interface_identifier_parameter(tvbuff_t *parameter_tvb, proto_tree
proto_tree_add_item(parameter_tree, hf_text_interface_id, parameter_tvb, TEXT_INTERFACE_ID_OFFSET, interface_id_length, ENC_ASCII|ENC_NA);
proto_item_append_text(parameter_item, " (%.*s)", interface_id_length,
- tvb_get_ephemeral_string(parameter_tvb, TEXT_INTERFACE_ID_OFFSET, interface_id_length));
+ tvb_get_string(wmem_packet_scope(), parameter_tvb, TEXT_INTERFACE_ID_OFFSET, interface_id_length));
}
#define INFO_STRING_OFFSET PARAMETER_VALUE_OFFSET
@@ -151,7 +151,7 @@ dissect_info_string_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tre
info_string_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
proto_tree_add_item(parameter_tree, hf_info_string, parameter_tvb, INFO_STRING_OFFSET, info_string_length, ENC_ASCII|ENC_NA);
proto_item_append_text(parameter_item, " (%.*s)", info_string_length,
- tvb_get_ephemeral_string(parameter_tvb, INFO_STRING_OFFSET, info_string_length));
+ tvb_get_string(wmem_packet_scope(), parameter_tvb, INFO_STRING_OFFSET, info_string_length));
}
#define DLCI_SAPI_LENGTH 1
diff --git a/epan/dissectors/packet-iuup.c b/epan/dissectors/packet-iuup.c
index 59d6ea9296..7843935ee8 100644
--- a/epan/dissectors/packet-iuup.c
+++ b/epan/dissectors/packet-iuup.c
@@ -333,7 +333,7 @@ iuup_proto_tree_add_bits(proto_tree* tree, int hf, tvbuff_t* tvb, int offset, in
DISSECTOR_ASSERT(bit_offset < 8);
- shifted_buffer = (guint8 *)ep_tvb_memdup(tvb,offset,len+1);
+ shifted_buffer = (guint8 *)tvb_memdup(wmem_packet_scope(),tvb,offset,len+1);
for(i = 0; i < len; i++) {
shifted_buffer[i] <<= bit_offset;
diff --git a/epan/dissectors/packet-json.c b/epan/dissectors/packet-json.c
index 23a95048da..d72d2ea326 100644
--- a/epan/dissectors/packet-json.c
+++ b/epan/dissectors/packet-json.c
@@ -207,7 +207,7 @@ static void after_member(void *tvbparse_data, const void *wanted_data _U_, tvbpa
tvbparse_elem_t *key_tok = tok->sub;
if (key_tok && key_tok->id == JSON_TOKEN_STRING) {
- char *key = tvb_get_ephemeral_string(key_tok->tvb, key_tok->offset, key_tok->len);
+ char *key = tvb_get_string(wmem_packet_scope(), key_tok->tvb, key_tok->offset, key_tok->len);
proto_item_append_text(tree, " Key: %s", key);
}
diff --git a/epan/dissectors/packet-jxta.c b/epan/dissectors/packet-jxta.c
index 38c0a6b85f..cf4370dee4 100644
--- a/epan/dissectors/packet-jxta.c
+++ b/epan/dissectors/packet-jxta.c
@@ -790,7 +790,7 @@ static int dissect_jxta_welcome(tvbuff_t * tvb, packet_info * pinfo, proto_tree
col_set_str(pinfo->cinfo, COL_INFO, "Welcome");
{
- gchar *welcomeline = tvb_get_ephemeral_string(tvb, offset, first_linelen);
+ gchar *welcomeline = tvb_get_string(wmem_packet_scope(), tvb, offset, first_linelen);
gchar **current_token;
guint token_offset = offset;
proto_item *jxta_welcome_tree_item = NULL;
@@ -1021,7 +1021,7 @@ static int dissect_jxta_message_framing(tvbuff_t * tvb, packet_info * pinfo, pro
if (content_type && (sizeof("content-type") - 1) == headername_len) {
if (0 == tvb_strncaseeql(tvb, headername_offset, "content-type", sizeof("content-type") - 1)) {
- *content_type = tvb_get_ephemeral_string(tvb, headervalue_offset, headervalue_len);
+ *content_type = tvb_get_string(wmem_packet_scope(), tvb, headervalue_offset, headervalue_len);
}
}
@@ -1376,7 +1376,7 @@ static int dissect_jxta_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree
for (each_name = 0; each_name < msg_names_count; each_name++) {
guint16 name_len = tvb_get_ntohs(tvb, tree_offset);
- names_table[2 + each_name] = tvb_get_ephemeral_string(tvb, tree_offset + (int)sizeof(name_len), name_len);
+ names_table[2 + each_name] = tvb_get_string(wmem_packet_scope(), tvb, tree_offset + (int)sizeof(name_len), name_len);
proto_tree_add_item(jxta_msg_tree, hf_jxta_message_names_name, tvb, tree_offset, (int)sizeof(name_len), ENC_ASCII|ENC_NA);
tree_offset += (int)sizeof(name_len) + name_len;
}
@@ -1627,7 +1627,7 @@ static int dissect_jxta_message_element_1(tvbuff_t * tvb, packet_info * pinfo, p
proto_tree_add_item(jxta_elem_tree, hf_jxta_element_type, tvb, tree_offset, (int)sizeof(guint16), ENC_ASCII|ENC_NA);
tree_offset += (int)sizeof(guint16);
- mediatype = tvb_get_ephemeral_string(tvb, tree_offset, type_len);
+ mediatype = tvb_get_string(wmem_packet_scope(), tvb, tree_offset, type_len);
tree_offset += type_len;
}
diff --git a/epan/dissectors/packet-kerberos.c b/epan/dissectors/packet-kerberos.c
index eeb32e48b2..b96a130495 100644
--- a/epan/dissectors/packet-kerberos.c
+++ b/epan/dissectors/packet-kerberos.c
@@ -2817,7 +2817,7 @@ dissect_krb5_PAC_CLIENT_INFO_TYPE(proto_tree *parent_tree, tvbuff_t *tvb, int of
offset+=2;
/* client name */
- name=tvb_get_ephemeral_unicode_string(tvb, offset, namelen, ENC_LITTLE_ENDIAN);
+ name=tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, namelen, ENC_LITTLE_ENDIAN);
proto_tree_add_string(tree, hf_krb_pac_clientname, tvb, offset, namelen, name);
offset+=namelen;
diff --git a/epan/dissectors/packet-kismet.c b/epan/dissectors/packet-kismet.c
index e2ed4b46af..b3502a86bf 100644
--- a/epan/dissectors/packet-kismet.c
+++ b/epan/dissectors/packet-kismet.c
@@ -165,7 +165,7 @@ dissect_kismet(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * da
tokenlen = get_token_len(line, line + linelen, &next_token);
if (tokenlen != 0) {
guint8 *reqresp;
- reqresp = tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ reqresp = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
if (is_request) {
/*
* No request dissection
diff --git a/epan/dissectors/packet-lapsat.c b/epan/dissectors/packet-lapsat.c
index fc8cacfe37..51d236d76e 100644
--- a/epan/dissectors/packet-lapsat.c
+++ b/epan/dissectors/packet-lapsat.c
@@ -505,7 +505,7 @@ dissect_lapsat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if ((plen + hlen) == tvb_length(tvb)) {
/* Need to integrate the last nibble */
- guint8 *data = (guint8 *)tvb_g_memdup(tvb, hlen, plen);
+ guint8 *data = (guint8 *)tvb_memdup(NULL, tvb, hlen, plen);
data[plen-1] |= tvb_get_guint8(tvb, 2) << 4;
payload = tvb_new_child_real_data(tvb, data, plen, plen);
tvb_set_free_cb(payload, g_free);
diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c
index 9e60f1c0df..f9c0da4be6 100644
--- a/epan/dissectors/packet-ldap.c
+++ b/epan/dissectors/packet-ldap.c
@@ -1153,7 +1153,7 @@ dissect_ldap_LDAPString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
ldap_do_protocolop(actx->pinfo);
if(parameter_tvb)
- ldapstring = tvb_get_ephemeral_string(parameter_tvb, 0, tvb_length_remaining(parameter_tvb, 0));
+ ldapstring = tvb_get_string(wmem_packet_scope(), parameter_tvb, 0, tvb_length_remaining(parameter_tvb, 0));
if(hf_index == hf_ldap_baseObject) {
/* this is search - put it on the scanline */
@@ -1291,7 +1291,7 @@ char *mechanism = NULL;
* different type and/or mechanism.
*/
if(!actx->pinfo->fd->flags.visited) {
- mechanism = tvb_get_g_string(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0));
+ mechanism = tvb_get_string(NULL, parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0));
ldap_info->first_auth_frame = 0; /* not known until we see the bind reply */
/*
* If the mechanism in this request is an empty string (which is
@@ -2370,7 +2370,7 @@ dissect_ldap_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
break;
if(i == len) {
- string = tvb_get_ephemeral_string(next_tvb, 0, tvb_length_remaining(next_tvb, 0));
+ string = tvb_get_string(wmem_packet_scope(), next_tvb, 0, tvb_length_remaining(next_tvb, 0));
proto_item_set_text(actx->created_item, "AttributeValue: %s", string);
}
}
@@ -2874,7 +2874,7 @@ dissect_ldap_LDAPOID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U
if (!parameter_tvb)
return offset;
- object_identifier_id = tvb_get_ephemeral_string(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0));
+ object_identifier_id = tvb_get_string(wmem_packet_scope(), parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0));
name = oid_resolved_from_string(object_identifier_id);
if(name){
@@ -4629,7 +4629,7 @@ dissect_ldap_oid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
* proto_tree_add_oid() instead.
*/
- oid=tvb_get_ephemeral_string(tvb, 0, tvb_length(tvb));
+ oid=tvb_get_string(wmem_packet_scope(), tvb, 0, tvb_length(tvb));
if(!oid){
return;
}
diff --git a/epan/dissectors/packet-ldss.c b/epan/dissectors/packet-ldss.c
index dcf7896861..3a3225e751 100644
--- a/epan/dissectors/packet-ldss.c
+++ b/epan/dissectors/packet-ldss.c
@@ -288,7 +288,7 @@ dissect_ldss_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
digest_type = tvb_get_guint8 (tvb, 2);
compression = tvb_get_guint8 (tvb, 3);
cookie = tvb_get_ntohl (tvb, 4);
- digest = (guint8 *)tvb_g_memdup (tvb, 8, DIGEST_LEN);
+ digest = (guint8 *)tvb_memdup (NULL, tvb, 8, DIGEST_LEN);
size = tvb_get_ntoh64 (tvb, 40);
offset = tvb_get_ntoh64 (tvb, 48);
targetTime = tvb_get_ntohl (tvb, 56);
@@ -522,7 +522,7 @@ dissect_ldss_transfer (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
FALSE);
/* Include new-line in line */
- line = (guint8 *)tvb_g_memdup(tvb, offset, linelen+1); /* XXX - memory leak? */
+ line = (guint8 *)tvb_memdup(NULL, tvb, offset, linelen+1); /* XXX - memory leak? */
if (tree) {
ti = proto_tree_add_text(ldss_tree, tvb, offset, linelen,
diff --git a/epan/dissectors/packet-lte-rrc.c b/epan/dissectors/packet-lte-rrc.c
index c5e1fc7a82..9e9ea13c77 100644
--- a/epan/dissectors/packet-lte-rrc.c
+++ b/epan/dissectors/packet-lte-rrc.c
@@ -5265,7 +5265,7 @@ dissect_lte_rrc_warningMessageSegment(tvbuff_t *warning_msg_seg_tvb, proto_tree
cb_data_page_tvb = tvb_new_subset(warning_msg_seg_tvb, offset, length, length);
cb_data_tvb = dissect_cbs_data(dataCodingScheme, cb_data_page_tvb, tree, pinfo, 0);
if (cb_data_tvb) {
- str = tvb_get_ephemeral_string(cb_data_tvb, 0, tvb_length(cb_data_tvb));
+ str = tvb_get_string(wmem_packet_scope(), cb_data_tvb, 0, tvb_length(cb_data_tvb));
proto_tree_add_string_format(tree, hf_lte_rrc_warningMessageSegment_decoded_page, warning_msg_seg_tvb, offset, 83,
str, "Decoded Page %u: %s", i+1, str);
}
@@ -9329,7 +9329,7 @@ dissect_lte_rrc_T_hnb_Name(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _
1, 48, FALSE, &hnb_name_tvb);
actx->created_item = proto_tree_add_unicode_string(tree, hf_index, hnb_name_tvb, 0, -1,
- tvb_get_ephemeral_string_enc(hnb_name_tvb, 0, tvb_length(hnb_name_tvb), ENC_UTF_8 | ENC_NA));
+ tvb_get_string_enc(wmem_packet_scope(), hnb_name_tvb, 0, tvb_length(hnb_name_tvb), ENC_UTF_8 | ENC_NA));
return offset;
diff --git a/epan/dissectors/packet-lwres.c b/epan/dissectors/packet-lwres.c
index 600c2e8b8b..a622c3585d 100644
--- a/epan/dissectors/packet-lwres.c
+++ b/epan/dissectors/packet-lwres.c
@@ -290,7 +290,7 @@ static void dissect_getnamebyaddr_response(tvbuff_t* tvb, proto_tree* lwres_tree
for(i=0; i<naliases; i++)
{
aliaslen = tvb_get_ntohs(tvb, offset);
- aliasname = tvb_get_ephemeral_string(tvb, offset + 2, aliaslen);
+ aliasname = tvb_get_string(wmem_packet_scope(), tvb, offset + 2, aliaslen);
alias_item = proto_tree_add_text(nba_resp_tree, tvb, offset, 2 + aliaslen, "Alias %s",aliasname);
alias_tree = proto_item_add_subtree(alias_item, ett_adn_alias);
@@ -416,7 +416,7 @@ static void dissect_getaddrsbyname_response(tvbuff_t* tvb, proto_tree* lwres_tre
for(i=0; i<naliases; i++)
{
aliaslen = tvb_get_ntohs(tvb, offset);
- aliasname = tvb_get_ephemeral_string(tvb, offset + 2, aliaslen);
+ aliasname = tvb_get_string(wmem_packet_scope(), tvb, offset + 2, aliaslen);
alias_item = proto_tree_add_text(adn_resp_tree, tvb, offset, 2 + aliaslen, "Alias %s",aliasname);
alias_tree = proto_item_add_subtree(alias_item, ett_adn_alias);
diff --git a/epan/dissectors/packet-m2tp.c b/epan/dissectors/packet-m2tp.c
index 5753e2eb41..bb54c4d16f 100644
--- a/epan/dissectors/packet-m2tp.c
+++ b/epan/dissectors/packet-m2tp.c
@@ -333,7 +333,7 @@ dissect_m2tp_info_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree,
if (parameter_tree) {
length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET);
info_string_length = length - PARAMETER_HEADER_LENGTH;
- info_string = tvb_get_ephemeral_string(parameter_tvb, INFO_STRING_OFFSET, info_string_length);
+ info_string = tvb_get_string(wmem_packet_scope(), parameter_tvb, INFO_STRING_OFFSET, info_string_length);
proto_tree_add_string(parameter_tree, hf_m2tp_info_string, parameter_tvb, INFO_STRING_OFFSET, info_string_length, info_string);
proto_item_set_text(parameter_item, "Info String (%.*s)", info_string_length, info_string);
}
diff --git a/epan/dissectors/packet-m2ua.c b/epan/dissectors/packet-m2ua.c
index 33684d9ce8..33243bf328 100644
--- a/epan/dissectors/packet-m2ua.c
+++ b/epan/dissectors/packet-m2ua.c
@@ -285,7 +285,7 @@ dissect_interface_identifier_text_parameter(tvbuff_t *parameter_tvb, proto_tree
proto_tree_add_item(parameter_tree, hf_interface_id_text, parameter_tvb, TEXT_INTERFACE_ID_OFFSET, interface_id_length, ENC_ASCII|ENC_NA);
proto_item_append_text(parameter_item, " (%.*s)", interface_id_length,
- tvb_get_ephemeral_string(parameter_tvb, TEXT_INTERFACE_ID_OFFSET, interface_id_length));
+ tvb_get_string(wmem_packet_scope(), parameter_tvb, TEXT_INTERFACE_ID_OFFSET, interface_id_length));
}
#define INFO_STRING_OFFSET PARAMETER_VALUE_OFFSET
@@ -298,7 +298,7 @@ dissect_info_string_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tre
info_string_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
proto_tree_add_item(parameter_tree, hf_info_string, parameter_tvb, INFO_STRING_OFFSET, info_string_length, ENC_ASCII|ENC_NA);
proto_item_append_text(parameter_item, " (%.*s)", info_string_length,
- tvb_get_ephemeral_string(parameter_tvb, INFO_STRING_OFFSET, info_string_length));
+ tvb_get_string(wmem_packet_scope(), parameter_tvb, INFO_STRING_OFFSET, info_string_length));
}
#define DIAGNOSTIC_INFO_OFFSET PARAMETER_VALUE_OFFSET
diff --git a/epan/dissectors/packet-m3ua.c b/epan/dissectors/packet-m3ua.c
index 697be634a7..9c7af8f37f 100644
--- a/epan/dissectors/packet-m3ua.c
+++ b/epan/dissectors/packet-m3ua.c
@@ -409,7 +409,7 @@ dissect_info_string_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tre
info_string_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
proto_tree_add_item(parameter_tree, hf_info_string, parameter_tvb, INFO_STRING_OFFSET, info_string_length, ENC_ASCII|ENC_NA);
proto_item_append_text(parameter_item, " (%.*s)", info_string_length,
- tvb_get_ephemeral_string(parameter_tvb, INFO_STRING_OFFSET, info_string_length));
+ tvb_get_string(wmem_packet_scope(), parameter_tvb, INFO_STRING_OFFSET, info_string_length));
}
#define AFFECTED_MASK_LENGTH 1
diff --git a/epan/dissectors/packet-memcache.c b/epan/dissectors/packet-memcache.c
index 3982c1c6fc..d2ae8f7b3d 100644
--- a/epan/dissectors/packet-memcache.c
+++ b/epan/dissectors/packet-memcache.c
@@ -650,7 +650,7 @@ get_payload_length (tvbuff_t *tvb, const int token_number, int offset,
return FALSE;
}
- bytes_val = tvb_get_ephemeral_string (tvb, offset, tokenlen);
+ bytes_val = tvb_get_string (wmem_packet_scope(), tvb, offset, tokenlen);
if (bytes_val) {
if (sscanf (bytes_val, "%u", bytes) == 1) {
*content_length_found = TRUE;
diff --git a/epan/dissectors/packet-mgcp.c b/epan/dissectors/packet-mgcp.c
index c8e104953e..f7831914e0 100644
--- a/epan/dissectors/packet-mgcp.c
+++ b/epan/dissectors/packet-mgcp.c
@@ -1346,7 +1346,7 @@ static gint tvb_parse_param(tvbuff_t* tvb, gint offset, gint len, int** hf)
/* set the observedEvents or signalReq used in Voip Calls analysis */
if (buf != NULL) {
- *buf = tvb_get_ephemeral_string(tvb, tvb_current_offset, (len - tvb_current_offset + offset));
+ *buf = tvb_get_string(wmem_packet_scope(), tvb, tvb_current_offset, (len - tvb_current_offset + offset));
}
}
}
@@ -1851,7 +1851,7 @@ dissect_mgcp_connectionparams(proto_tree *parent_tree, tvbuff_t *tvb, gint offse
/* The P: line */
offset += param_type_len; /* skip the P: */
- tokenline = tvb_get_ephemeral_string(tvb, offset, param_val_len);
+ tokenline = tvb_get_string(wmem_packet_scope(), tvb, offset, param_val_len);
/* Split into type=value pairs separated by comma */
tokens = wmem_strsplit(wmem_packet_scope(), tokenline, ",", -1);
@@ -1963,7 +1963,7 @@ dissect_mgcp_localconnectionoptions(proto_tree *parent_tree, tvbuff_t *tvb, gint
/* The L: line */
offset += param_type_len; /* skip the L: */
- tokenline = tvb_get_ephemeral_string(tvb, offset, param_val_len);
+ tokenline = tvb_get_string(wmem_packet_scope(), tvb, offset, param_val_len);
/* Split into type=value pairs separated by comma */
tokens = wmem_strsplit(wmem_packet_scope(), tokenline, ",", -1);
diff --git a/epan/dissectors/packet-mih.c b/epan/dissectors/packet-mih.c
index d09cabb722..a0e5a56042 100644
--- a/epan/dissectors/packet-mih.c
+++ b/epan/dissectors/packet-mih.c
@@ -1948,7 +1948,7 @@ static void dissect_mih_tlv(tvbuff_t *tvb,int offset, proto_tree *tlv_tree, guin
case VEND_SPECIFIC_TLV :
/*Vendor specific tlv*/
- proto_tree_add_text(tlv_tree, tvb, offset, length, "Vendor Specific TLV :%s", tvb_get_g_string(tvb, offset, length));
+ proto_tree_add_text(tlv_tree, tvb, offset, length, "Vendor Specific TLV :%s", tvb_get_string(wmem_packet_scope(), tvb, offset, length));
break;
default :/*did not match type*/
@@ -1956,15 +1956,15 @@ static void dissect_mih_tlv(tvbuff_t *tvb,int offset, proto_tree *tlv_tree, guin
/*RESERVED TLVs*/
if(type > 63 && type < 100)
- proto_tree_add_text(tlv_tree, tvb, offset, length, "Reserved TLV :%s", tvb_get_g_string(tvb, offset, length));
+ proto_tree_add_text(tlv_tree, tvb, offset, length, "Reserved TLV :%s", tvb_get_string(wmem_packet_scope(), tvb, offset, length));
/*EXPERIMENTAL TLVs*/
else if(type > 100 && type < 255)
- proto_tree_add_text(tlv_tree, tvb, offset, length, "Experimental TLV :%s", tvb_get_g_string(tvb, offset, length));
+ proto_tree_add_text(tlv_tree, tvb, offset, length, "Experimental TLV :%s", tvb_get_string(wmem_packet_scope(), tvb, offset, length));
/*UNKNOWN TLVs*/
else
- proto_tree_add_text(tlv_tree, tvb, offset, length, "UNKNOWN TLV :%s", tvb_get_g_string(tvb, offset, length));
+ proto_tree_add_text(tlv_tree, tvb, offset, length, "UNKNOWN TLV :%s", tvb_get_string(wmem_packet_scope(), tvb, offset, length));
}
return;
}
diff --git a/epan/dissectors/packet-mikey.c b/epan/dissectors/packet-mikey.c
index ea611ae1a8..c671a48d73 100644
--- a/epan/dissectors/packet-mikey.c
+++ b/epan/dissectors/packet-mikey.c
@@ -938,7 +938,7 @@ dissect_payload_id(mikey_t *mikey _U_, tvbuff_t *tvb, packet_info *pinfo _U_, pr
parent = proto_tree_get_parent(tree);
proto_item_append_text(parent, " %s: %s",
val_to_str_const(type, id_type_vals, "Unknown"),
- tvb_get_ephemeral_string(tvb, 4, length));
+ tvb_get_string(wmem_packet_scope(), tvb, 4, length));
}
return 4 + length;
@@ -968,7 +968,7 @@ dissect_payload_idr(mikey_t *mikey _U_, tvbuff_t *tvb, packet_info *pinfo _U_, p
parent = proto_tree_get_parent(tree);
proto_item_append_text(parent, " %s: %s",
val_to_str_const(type, id_type_vals, "Unknown"),
- tvb_get_ephemeral_string(tvb, 5, length));
+ tvb_get_string(wmem_packet_scope(), tvb, 5, length));
}
return 5 + length;
diff --git a/epan/dissectors/packet-mmse.c b/epan/dissectors/packet-mmse.c
index 87dfdc8375..8bcc968e2e 100644
--- a/epan/dissectors/packet-mmse.c
+++ b/epan/dissectors/packet-mmse.c
@@ -460,9 +460,9 @@ get_text_string(tvbuff_t *tvb, guint offset, const char **strval)
len = tvb_strsize(tvb, offset);
DebugLog((" [1] tvb_strsize(tvb, offset) == %u\n", len));
if (tvb_get_guint8(tvb, offset) == MM_QUOTE)
- *strval = (const char *)ep_tvb_memdup(tvb, offset+1, len-1);
+ *strval = (const char *)tvb_memdup(wmem_packet_scope(), tvb, offset+1, len-1);
else
- *strval = (const char *)ep_tvb_memdup(tvb, offset, len);
+ *strval = (const char *)tvb_memdup(wmem_packet_scope(), tvb, offset, len);
DebugLog((" [3] Return(len) == %u\n", len));
return len;
}
@@ -525,7 +525,7 @@ get_encoded_strval(tvbuff_t *tvb, guint offset, const char **strval)
*strval = "";
} else {
/* \todo Something with "Char-set", skip for now */
- *strval = (char *)tvb_get_ephemeral_string(tvb, offset + count + 1, length - 1);
+ *strval = (char *)tvb_get_string(wmem_packet_scope(), tvb, offset + count + 1, length - 1);
}
return count + length;
} else
@@ -1279,7 +1279,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut,
proto_tree_add_string_format(mmse_tree,
hf_mmse_ffheader, tvb, offset,
length + length2,
- tvb_get_ephemeral_string(tvb, offset,
+ tvb_get_string(wmem_packet_scope(), tvb, offset,
length + length2),
"%s: %s",
format_text(strval, strlen(strval)),
diff --git a/epan/dissectors/packet-mq-pcf.c b/epan/dissectors/packet-mq-pcf.c
index fa14707ac7..0f6d551f82 100644
--- a/epan/dissectors/packet-mq-pcf.c
+++ b/epan/dissectors/packet-mq-pcf.c
@@ -204,7 +204,7 @@ static void dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq
uCCS=tvb_get_guint32_endian(tvb, offset + uLenF, bLittleEndian);
uSLn=tvb_get_guint32_endian(tvb, offset + uLenF + 4, bLittleEndian);
- sStr=tvb_get_ephemeral_string_enc(tvb, offset + uLenF + 8,uSLn,(uCCS!=500)?ENC_ASCII:ENC_EBCDIC);
+ sStr=tvb_get_string_enc(wmem_packet_scope(), tvb, offset + uLenF + 8,uSLn,(uCCS!=500)?ENC_ASCII:ENC_EBCDIC);
strip_trailing_blanks(sStr,uSLn);
ti = proto_tree_add_text(mq_tree, tvb, offset, uLen, "%s %s", strPrm, sStr);
@@ -288,8 +288,8 @@ static void dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq
uSLn=tvb_get_guint32_endian(tvb, offset + uLenF, bLittleEndian);
if (uSLn)
{
- guint8 *sStrA=tvb_get_ephemeral_string_enc(tvb, offset + uLenF + 4,uSLn,ENC_ASCII);
- guint8 *sStrE=tvb_get_ephemeral_string_enc(tvb, offset + uLenF + 4,uSLn,ENC_EBCDIC);
+ guint8 *sStrA=tvb_get_string_enc(wmem_packet_scope(), tvb, offset + uLenF + 4,uSLn,ENC_ASCII);
+ guint8 *sStrE=tvb_get_string_enc(wmem_packet_scope(), tvb, offset + uLenF + 4,uSLn,ENC_EBCDIC);
ti = proto_tree_add_text(mq_tree, tvb, offset, uLen, "%s A(%s) E(%s)", strPrm, sStrA,sStrE);
}
else
diff --git a/epan/dissectors/packet-mq.c b/epan/dissectors/packet-mq.c
index 1a095df4c3..7e4324b2ae 100644
--- a/epan/dissectors/packet-mq.c
+++ b/epan/dissectors/packet-mq.c
@@ -1407,7 +1407,7 @@ static gint dissect_mq_charv(tvbuff_t *tvb, proto_tree *tree, gint offset,gint i
eStr = tvb_get_guint32_endian(tvb, offset + 16, p_mq_parm->mq_int_enc);
if (lStr && oStr)
{
- sStr = tvb_get_ephemeral_string_enc(tvb, oStr, lStr, p_mq_parm->mq_str_enc);
+ sStr = tvb_get_string_enc(wmem_packet_scope(), tvb, oStr, lStr, p_mq_parm->mq_str_enc);
}
else
sStr=NULL;
@@ -1551,7 +1551,7 @@ static gint dissect_mq_gmo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (iSize != 0 && tvb_length_remaining(tvb, offset) >= iSize)
{
guint8 *sQueue;
- sQueue = tvb_get_ephemeral_string_enc(tvb, offset + 24, 48, p_mq_parm->mq_str_enc);
+ sQueue = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 24, 48, p_mq_parm->mq_str_enc);
if (strip_trailing_blanks(sQueue, 48) != 0)
{
col_append_fstr(pinfo->cinfo, COL_INFO, " Q=%s", sQueue);
@@ -1617,7 +1617,7 @@ static gint dissect_mq_pmo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
guint8 * sQueue;
- sQueue = tvb_get_ephemeral_string_enc(tvb, offset + 32, 48, p_mq_parm->mq_str_enc);
+ sQueue = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 32, 48, p_mq_parm->mq_str_enc);
if (strip_trailing_blanks(sQueue, 48) != 0)
{
col_append_fstr(pinfo->cinfo, COL_INFO, " Q=%s", sQueue);
@@ -1705,7 +1705,7 @@ static gint dissect_mq_od(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
if (iVersion >= 2)
iNbrRecords = tvb_get_guint32_endian(tvb, offset + 168, p_mq_parm->mq_int_enc);
- sQueue = tvb_get_ephemeral_string_enc(tvb, offset + 12, 48, p_mq_parm->mq_str_enc);
+ sQueue = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 12, 48, p_mq_parm->mq_str_enc);
if (strip_trailing_blanks(sQueue,48) != 0)
{
col_append_fstr(pinfo->cinfo, COL_INFO, " Obj=%s", sQueue);
@@ -1848,7 +1848,7 @@ static gint dissect_mq_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mqroot_
if (iSize != 0 && tvb_length_remaining(tvb, offset) >= iSize)
{
guint8 *sChannel;
- sChannel = tvb_get_ephemeral_string_enc(tvb, offset + 24, 20, p_mq_parm->mq_str_enc);
+ sChannel = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 24, 20, p_mq_parm->mq_str_enc);
col_append_fstr(pinfo->cinfo,COL_INFO, ": FAPLvl=%d",iFAPLvl);
if (strip_trailing_blanks(sChannel, 20) != 0)
{
@@ -1857,7 +1857,7 @@ static gint dissect_mq_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mqroot_
if (iFAPLvl >= 4)
{
guint8 *sQMgr;
- sQMgr = tvb_get_ephemeral_string_enc(tvb, offset + 48, 48, p_mq_parm->mq_str_enc);
+ sQMgr = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 48, 48, p_mq_parm->mq_str_enc);
if (strip_trailing_blanks(sQMgr,48) != 0)
{
col_append_fstr(pinfo->cinfo, COL_INFO, ", QM=%s", sQMgr);
@@ -2341,12 +2341,12 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint8 *sApplicationName;
guint8 *sQMgr;
- sApplicationName = tvb_get_ephemeral_string_enc(tvb, offset + 48, 28, p_mq_parm->mq_str_enc);
+ sApplicationName = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 48, 28, p_mq_parm->mq_str_enc);
if (strip_trailing_blanks(sApplicationName, 28) != 0)
{
col_append_fstr(pinfo->cinfo, COL_INFO, ": App=%s", sApplicationName);
}
- sQMgr = tvb_get_ephemeral_string_enc(tvb, offset, 48, p_mq_parm->mq_str_enc);
+ sQMgr = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 48, p_mq_parm->mq_str_enc);
if (strip_trailing_blanks(sQMgr, 48) != 0)
{
col_append_fstr(pinfo->cinfo, COL_INFO, " QM=%s", sQMgr);
@@ -2638,7 +2638,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree)
{
guint8 *sStructId;
- sStructId = tvb_get_ephemeral_string_enc(tvb, offset, 4,((p_mq_parm->mq_strucID & MQ_MASK_SPxx)==MQ_STRUCTID_SPxx)?ENC_ASCII:ENC_EBCDIC);
+ sStructId = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 4,((p_mq_parm->mq_strucID & MQ_MASK_SPxx)==MQ_STRUCTID_SPxx)?ENC_ASCII:ENC_EBCDIC);
ti = proto_tree_add_text(mqroot_tree, tvb, offset, 12, "%s", sStructId);
mq_tree = proto_item_add_subtree(ti, ett_mq_spi_base);
@@ -2669,7 +2669,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
/* Dissect the common part of these structures */
guint8 *sStructId;
- sStructId = tvb_get_ephemeral_string_enc(tvb, offset, 4,((p_mq_parm->mq_strucID & MQ_MASK_SPxx)==MQ_STRUCTID_SPxx)?ENC_ASCII:ENC_EBCDIC);
+ sStructId = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 4,((p_mq_parm->mq_strucID & MQ_MASK_SPxx)==MQ_STRUCTID_SPxx)?ENC_ASCII:ENC_EBCDIC);
ti = proto_tree_add_text(mqroot_tree, tvb, offset, -1, "%s", sStructId);
mq_tree = proto_item_add_subtree(ti, ett_mq_spi_base);
@@ -2896,7 +2896,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (iSizeUID != 0 && tvb_length_remaining(tvb, offset) >= iSizeUID)
{
guint8 *sUserId;
- sUserId = tvb_get_ephemeral_string_enc(tvb, offset + 4, 12, p_mq_parm->mq_str_enc);
+ sUserId = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 4, 12, p_mq_parm->mq_str_enc);
if (strip_trailing_blanks(sUserId, 12) != 0)
{
col_append_fstr(pinfo->cinfo, COL_INFO, ": User=%s", sUserId);
@@ -3162,7 +3162,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tMsgProps.iOffsetFormat != 0)
{
guint8* sFormat = NULL;
- sFormat = tvb_get_ephemeral_string_enc(tvb, tMsgProps.iOffsetFormat, 8, p_mq_parm->mq_str_enc);
+ sFormat = tvb_get_string_enc(wmem_packet_scope(), tvb, tMsgProps.iOffsetFormat, 8, p_mq_parm->mq_str_enc);
if (strip_trailing_blanks(sFormat, 8) == 0)
sFormat = (guint8 *)wmem_strdup(wmem_packet_scope(),"MQNONE");
@@ -3188,7 +3188,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
mqinfo->encoding = tvb_get_guint32_endian(tvb, tMsgProps.iOffsetEncoding, p_mq_parm->mq_int_enc);
mqinfo->ccsid = tvb_get_guint32_endian(tvb, tMsgProps.iOffsetCcsid, p_mq_parm->mq_int_enc);
memcpy(mqinfo->format,
- tvb_get_ephemeral_string_enc(tvb, tMsgProps.iOffsetFormat, sizeof(mqinfo->format), p_mq_parm->mq_str_enc),
+ tvb_get_string_enc(wmem_packet_scope(), tvb, tMsgProps.iOffsetFormat, sizeof(mqinfo->format), p_mq_parm->mq_str_enc),
sizeof(mqinfo->format));
pd_save = pinfo->private_data;
pinfo->private_data = mqinfo;
diff --git a/epan/dissectors/packet-mrcpv2.c b/epan/dissectors/packet-mrcpv2.c
index 597ee81f16..dfe9f224eb 100644
--- a/epan/dissectors/packet-mrcpv2.c
+++ b/epan/dissectors/packet-mrcpv2.c
@@ -458,35 +458,35 @@ dissect_mrcpv2_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
sp_end = tvb_find_guint8(tvb, 0, linelen, ' ');
if ((sp_end == -1) || (sp_end > tvb_len) || (sp_end > linelen))
return -1;
- field1 = tvb_get_ephemeral_string(tvb, 0, sp_end);
+ field1 = tvb_get_string(wmem_packet_scope(), tvb, 0, sp_end);
sp_start = sp_end + 1;
/* length */
sp_end = tvb_find_guint8(tvb, sp_start, linelen - sp_start, ' ');
if ((sp_end == -1) || (sp_end > tvb_len) || (sp_end > linelen))
return -1;
- field2 = tvb_get_ephemeral_string(tvb, sp_start, sp_end - sp_start);
+ field2 = tvb_get_string(wmem_packet_scope(), tvb, sp_start, sp_end - sp_start);
sp_start = sp_end + 1;
/* method, request ID or event */
sp_end = tvb_find_guint8(tvb, sp_start, linelen - sp_start, ' ');
if ((sp_end == -1) || (sp_end > tvb_len) || (sp_end > linelen))
return -1;
- field3 = tvb_get_ephemeral_string(tvb, sp_start, sp_end - sp_start);
+ field3 = tvb_get_string(wmem_packet_scope(), tvb, sp_start, sp_end - sp_start);
sp_start = sp_end + 1;
/* request ID or status code */
sp_end = tvb_find_guint8(tvb, sp_start, linelen - sp_start, ' ');
if (sp_end == -1)
{
- field4 = tvb_get_ephemeral_string(tvb, sp_start, linelen - sp_start);
+ field4 = tvb_get_string(wmem_packet_scope(), tvb, sp_start, linelen - sp_start);
line_type = REQUEST_LINE; /* only request line has 4 parameters */
}
else
{
if ((sp_end > tvb_len) || (sp_end > linelen))
return -1;
- field4 = tvb_get_ephemeral_string(tvb, sp_start, sp_end - sp_start);
+ field4 = tvb_get_string(wmem_packet_scope(), tvb, sp_start, sp_end - sp_start);
if (isdigit(field3[0])) /* request ID is number, so it has to be response */
line_type = RESPONSE_LINE;
@@ -497,7 +497,7 @@ dissect_mrcpv2_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
sp_end = linelen;
if ((sp_end > tvb_len) || (sp_end > linelen))
return -1;
- field5 = tvb_get_ephemeral_string(tvb, sp_start, sp_end - sp_start);
+ field5 = tvb_get_string(wmem_packet_scope(), tvb, sp_start, sp_end - sp_start);
}
/* check pdu size */
@@ -626,10 +626,10 @@ dissect_mrcpv2_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(mrcpv2_tree, hf_mrcpv2_Unknown_Header, tvb, offset, linelen, ENC_UTF_8);
continue;
}
- header_name = tvb_get_ephemeral_string(tvb, offset, colon_offset - offset);
+ header_name = tvb_get_string(wmem_packet_scope(), tvb, offset, colon_offset - offset);
ascii_strdown_inplace(header_name);
value_offset = tvb_skip_wsp(tvb, colon_offset + 1, offset + linelen - (colon_offset + 1));
- header_value = tvb_get_ephemeral_string(tvb, value_offset, offset + linelen - value_offset);
+ header_value = tvb_get_string(wmem_packet_scope(), tvb, value_offset, offset + linelen - value_offset);
/* find out header type */
header_type = UNKNOWN;
@@ -949,9 +949,9 @@ get_mrcpv2_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
/* second string is message length */
len_end = tvb_find_guint8(tvb, len_start, MRCPV2_MIN_PDU_LEN - len_start, ' ');
if (len_end == -1)
- msg_len = tvb_get_ephemeral_string(tvb, len_start, MRCPV2_MIN_PDU_LEN - len_start);
+ msg_len = tvb_get_string(wmem_packet_scope(), tvb, len_start, MRCPV2_MIN_PDU_LEN - len_start);
else
- msg_len = tvb_get_ephemeral_string(tvb, len_start, len_end - len_start);
+ msg_len = tvb_get_string(wmem_packet_scope(), tvb, len_start, len_end - len_start);
num_msg_len = atoi(msg_len);
return num_msg_len;
@@ -984,7 +984,7 @@ dissect_mrcpv2_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
slash_offset = tvb_find_guint8(tvb, 0, MRCPV2_MIN_LENGTH, '/');
if (slash_offset != 4)
return 0;
- version = tvb_get_ephemeral_string(tvb, 0, slash_offset);
+ version = tvb_get_string(wmem_packet_scope(), tvb, 0, slash_offset);
if (strcmp(version, "MRCP") != 0)
return 0;
@@ -995,7 +995,7 @@ dissect_mrcpv2_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
value_size = dot_offset - slash_offset - 1;
if ((value_size != 1) && (value_size != 2))
return 0;
- major = tvb_get_ephemeral_string(tvb, slash_offset + 1, dot_offset - 1);
+ major = tvb_get_string(wmem_packet_scope(), tvb, slash_offset + 1, dot_offset - 1);
value = atoi(major);
if (value != 2)
return 0;
@@ -1004,12 +1004,12 @@ dissect_mrcpv2_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
sp_offset = tvb_find_guint8(tvb, dot_offset + 1, MRCPV2_MIN_LENGTH - dot_offset - 1, ' ');
if (sp_offset == -1)
{
- minor = tvb_get_ephemeral_string(tvb, dot_offset + 1, MRCPV2_MIN_LENGTH - dot_offset - 1);
+ minor = tvb_get_string(wmem_packet_scope(), tvb, dot_offset + 1, MRCPV2_MIN_LENGTH - dot_offset - 1);
len = MRCPV2_MIN_LENGTH;
}
else
{
- minor = tvb_get_ephemeral_string(tvb, dot_offset + 1, MRCPV2_MIN_LENGTH - sp_offset - 1);
+ minor = tvb_get_string(wmem_packet_scope(), tvb, dot_offset + 1, MRCPV2_MIN_LENGTH - sp_offset - 1);
len = sp_offset;
}
value = atoi(minor);
diff --git a/epan/dissectors/packet-ms-mms.c b/epan/dissectors/packet-ms-mms.c
index 936e0d9783..cbe8cdff45 100644
--- a/epan/dissectors/packet-ms-mms.c
+++ b/epan/dissectors/packet-ms-mms.c
@@ -435,7 +435,7 @@ static gint dissect_msmms_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree
offset += 4;
/* Protocol name. Must be "MMS"... */
- if (strncmp((char*)tvb_get_ephemeral_string(tvb, offset, 3), "MMS", 3) != 0)
+ if (strncmp((char*)tvb_get_string(wmem_packet_scope(), tvb, offset, 3), "MMS", 3) != 0)
{
return 0;
}
@@ -759,7 +759,7 @@ static void dissect_client_transport_info(tvbuff_t *tvb, packet_info *pinfo, pro
offset += 4;
/* Extract and show the string in tree and info column */
- transport_info = tvb_get_ephemeral_unicode_string(tvb, offset, length_remaining - 20, ENC_LITTLE_ENDIAN);
+ transport_info = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, length_remaining - 20, ENC_LITTLE_ENDIAN);
proto_tree_add_string_format(tree, hf_msmms_command_client_transport_info, tvb,
offset, length_remaining-20,
@@ -867,7 +867,7 @@ static void dissect_server_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
THROW(ReportedBoundsError);
if (server_version_length > 1)
{
- server_version = tvb_get_ephemeral_unicode_string(tvb, offset, server_version_length*2, ENC_LITTLE_ENDIAN);
+ server_version = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, server_version_length*2, ENC_LITTLE_ENDIAN);
/* Server version string */
proto_tree_add_item(tree, hf_msmms_command_server_version, tvb,
@@ -933,7 +933,7 @@ static void dissect_client_player_info(tvbuff_t *tvb, packet_info *pinfo, proto_
offset += 4;
/* Extract and show the string in tree and info column */
- player_info = tvb_get_ephemeral_unicode_string(tvb, offset, length_remaining - 12, ENC_LITTLE_ENDIAN);
+ player_info = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, length_remaining - 12, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_msmms_command_client_player_info, tvb,
offset, length_remaining-12,
@@ -1010,7 +1010,7 @@ static void dissect_request_server_file(tvbuff_t *tvb, packet_info *pinfo, proto
offset += 4;
/* File path on server */
- server_file = tvb_get_ephemeral_unicode_string(tvb, offset, length_remaining - 16, ENC_LITTLE_ENDIAN);
+ server_file = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, length_remaining - 16, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_msmms_command_server_file, tvb,
offset, length_remaining-16,
diff --git a/epan/dissectors/packet-msproxy.c b/epan/dissectors/packet-msproxy.c
index c0b24a7302..a2a2133d14 100644
--- a/epan/dissectors/packet-msproxy.c
+++ b/epan/dissectors/packet-msproxy.c
@@ -314,7 +314,7 @@ static int display_application_name(tvbuff_t *tvb, int offset,
length = tvb_strnlen( tvb, offset, 255);
proto_tree_add_text( tree, tvb, offset, length, "Application: %.*s",
- length, tvb_get_ephemeral_string( tvb, offset, length));
+ length, tvb_get_string( wmem_packet_scope(), tvb, offset, length));
return length;
}
@@ -377,7 +377,7 @@ static void dissect_user_info_2(tvbuff_t *tvb, int offset,
return;
proto_tree_add_text( tree, tvb, offset, length + 1,
"User name: %.*s", length,
- tvb_get_ephemeral_string( tvb, offset, length));
+ tvb_get_string( wmem_packet_scope(), tvb, offset, length));
offset += length + 2;
length = tvb_strnlen( tvb, offset, 255);
@@ -385,7 +385,7 @@ static void dissect_user_info_2(tvbuff_t *tvb, int offset,
return;
proto_tree_add_text( tree, tvb, offset, length + 1,
"Application name: %.*s", length,
- tvb_get_ephemeral_string( tvb, offset, length));
+ tvb_get_string( wmem_packet_scope(), tvb, offset, length));
offset += length + 1;
length = tvb_strnlen( tvb, offset, 255);
@@ -393,7 +393,7 @@ static void dissect_user_info_2(tvbuff_t *tvb, int offset,
return;
proto_tree_add_text( tree, tvb, offset, length + 1,
"Client computer name: %.*s", length,
- tvb_get_ephemeral_string( tvb, offset, length));
+ tvb_get_string( wmem_packet_scope(), tvb, offset, length));
}
}
@@ -582,7 +582,7 @@ static void dissect_request_resolve(tvbuff_t *tvb, int offset,
if ( tree){
ti = proto_tree_add_text(tree, tvb, offset, length + 1,
"Host Name: %.*s", length,
- tvb_get_ephemeral_string( tvb, offset + 18, length));
+ tvb_get_string( wmem_packet_scope(), tvb, offset + 18, length));
name_tree = proto_item_add_subtree(ti, ett_msproxy_name);
@@ -593,7 +593,7 @@ static void dissect_request_resolve(tvbuff_t *tvb, int offset,
offset += 17;
proto_tree_add_text( name_tree, tvb, offset, length, "String: %s",
- tvb_get_ephemeral_string( tvb, offset, length));
+ tvb_get_string( wmem_packet_scope(), tvb, offset, length));
}
}
@@ -813,7 +813,7 @@ static void dissect_auth_1_ack(tvbuff_t *tvb, int offset,
/* XXX - always 255? */
proto_tree_add_text( tree, tvb, offset, 255, "NT domain: %.255s",
- tvb_get_ephemeral_string( tvb, offset, 255));
+ tvb_get_string( wmem_packet_scope(), tvb, offset, 255));
}
}
diff --git a/epan/dissectors/packet-msrp.c b/epan/dissectors/packet-msrp.c
index 1782753df9..e8940d2058 100644
--- a/epan/dissectors/packet-msrp.c
+++ b/epan/dissectors/packet-msrp.c
@@ -568,7 +568,7 @@ dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
reqresp_tree = proto_item_add_subtree(th, ett_msrp_reqresp);
proto_tree_add_item(reqresp_tree,hf_msrp_transactionID,tvb,token_2_start,token_2_len,ENC_ASCII|ENC_NA);
proto_tree_add_uint(reqresp_tree,hf_msrp_status_code,tvb,token_3_start,token_3_len,
- atoi(tvb_get_ephemeral_string(tvb, token_3_start, token_3_len)));
+ atoi(tvb_get_string(wmem_packet_scope(), tvb, token_3_start, token_3_len)));
}else{
th = proto_tree_add_item(msrp_tree,hf_msrp_request_line,tvb,0,linelen,ENC_ASCII|ENC_NA);
@@ -632,7 +632,7 @@ dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
* Fetch the value.
*/
value_len = line_end_offset - value_offset;
- value = tvb_get_ephemeral_string(tvb, value_offset,
+ value = tvb_get_string(wmem_packet_scope(), tvb, value_offset,
value_len);
/*
@@ -661,11 +661,11 @@ dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
parameter_offset++;
content_type_len = semi_colon_offset - value_offset;
content_type_parameter_str_len = line_end_offset - parameter_offset;
- content_type_parameter_str = tvb_get_ephemeral_string(tvb,
+ content_type_parameter_str = tvb_get_string(wmem_packet_scope(), tvb,
parameter_offset, content_type_parameter_str_len);
}
media_type_str_lower_case = ascii_strdown_inplace(
- (gchar *)tvb_get_ephemeral_string(tvb, value_offset, content_type_len));
+ (gchar *)tvb_get_string(wmem_packet_scope(), tvb, value_offset, content_type_len));
break;
default:
diff --git a/epan/dissectors/packet-multipart.c b/epan/dissectors/packet-multipart.c
index 0415783d5c..7baffacf4e 100644
--- a/epan/dissectors/packet-multipart.c
+++ b/epan/dissectors/packet-multipart.c
@@ -175,7 +175,7 @@ base64_decode(packet_info *pinfo, tvbuff_t *b64_tvb, char *name)
{
char *data;
tvbuff_t *tvb;
- data = tvb_get_ephemeral_string(b64_tvb, 0, tvb_length(b64_tvb));
+ data = tvb_get_string(wmem_packet_scope(), b64_tvb, 0, tvb_length(b64_tvb));
tvb = base64_to_tvb(b64_tvb, data);
add_new_data_source(pinfo, tvb, name);
@@ -615,7 +615,7 @@ process_body_part(proto_tree *tree, tvbuff_t *tvb, const guint8 *boundary,
break;
}
- hdr_str = tvb_get_ephemeral_string(tvb, offset, next_offset - offset);
+ hdr_str = tvb_get_string(wmem_packet_scope(), tvb, offset, next_offset - offset);
header_str = unfold_and_compact_mime_header(hdr_str, &colon_offset);
if (colon_offset <= 0) {
diff --git a/epan/dissectors/packet-mux27010.c b/epan/dissectors/packet-mux27010.c
index 99a215ad37..5a7fa68cf5 100644
--- a/epan/dissectors/packet-mux27010.c
+++ b/epan/dissectors/packet-mux27010.c
@@ -727,7 +727,7 @@ getFrameInformation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *field_tree,
int offset, guint16 length_info){
/*Get the data from information field as string*/
- char *information_field = tvb_get_ephemeral_string(tvb,offset,length_info);
+ char *information_field = tvb_get_string(wmem_packet_scope(), tvb,offset,length_info);
/*delete unneeded signs out of info field -> for info column: CR (0x0d) and LF (0x0a)*/
information_field = g_strdelimit(information_field, "\r\n", ' ');
diff --git a/epan/dissectors/packet-mysql.c b/epan/dissectors/packet-mysql.c
index 0d6aea5e41..b3cf2701ca 100644
--- a/epan/dissectors/packet-mysql.c
+++ b/epan/dissectors/packet-mysql.c
@@ -858,7 +858,7 @@ mysql_dissect_greeting(tvbuff_t *tvb, packet_info *pinfo, int offset,
/* version string */
lenstr = tvb_strsize(tvb,offset);
- col_append_fstr(pinfo->cinfo, COL_INFO, " version=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " version=%s", tvb_get_string(wmem_packet_scope(), tvb, offset, lenstr));
proto_tree_add_item(greeting_tree, hf_mysql_version, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
conn_data->major_version = 0;
@@ -945,7 +945,7 @@ mysql_dissect_login(tvbuff_t *tvb, packet_info *pinfo, int offset,
/* User name */
lenstr = my_tvb_strsize(tvb, offset);
- col_append_fstr(pinfo->cinfo, COL_INFO, " user=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " user=%s", tvb_get_string(wmem_packet_scope(), tvb, offset, lenstr));
proto_tree_add_item(login_tree, hf_mysql_user, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
offset += lenstr;
@@ -972,7 +972,7 @@ mysql_dissect_login(tvbuff_t *tvb, packet_info *pinfo, int offset,
return offset;
}
- col_append_fstr(pinfo->cinfo, COL_INFO, " db=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " db=%s", tvb_get_string(wmem_packet_scope(), tvb, offset, lenstr));
proto_tree_add_item(login_tree, hf_mysql_schema, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
offset += lenstr;
@@ -1218,7 +1218,7 @@ mysql_dissect_request(tvbuff_t *tvb,packet_info *pinfo, int offset,
lenstr = my_tvb_strsize(tvb, offset);
proto_tree_add_item(req_tree, hf_mysql_query, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
if (mysql_showquery) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " { %s } ", tvb_get_ephemeral_string(tvb, offset, lenstr));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " { %s } ", tvb_get_string(wmem_packet_scope(), tvb, offset, lenstr));
}
offset += lenstr;
conn_data->state = RESPONSE_TABULAR;
diff --git a/epan/dissectors/packet-nasdaq-itch.c b/epan/dissectors/packet-nasdaq-itch.c
index bbb008c3a5..2ce2a2e8e4 100644
--- a/epan/dissectors/packet-nasdaq-itch.c
+++ b/epan/dissectors/packet-nasdaq-itch.c
@@ -152,7 +152,7 @@ static int hf_nasdaq_itch_cross = -1;
static int
order_ref_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int offset)
{
- const char *str_value = tvb_get_ephemeral_string(tvb, offset, 9);
+ const char *str_value = tvb_get_string(wmem_packet_scope(), tvb, offset, 9);
guint32 value = (guint32)strtoul(str_value, NULL, 10);
proto_tree_add_uint(nasdaq_itch_tree, hf_nasdaq_itch_order_reference, tvb, offset, 9, value);
@@ -169,7 +169,7 @@ time_stamp(tvbuff_t *tvb, proto_tree *nasdaq_itch_tree, int id, int offset, int
if (nasdaq_itch_tree) {
guint32 ms, val;
const char *display = "";
- const char *str_value = tvb_get_ephemeral_string(tvb, offset, size);
+ const char *str_value = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
ms = val = (guint32)strtoul(str_value, NULL, 10);
switch (size) {
@@ -193,7 +193,7 @@ static int
number_of_shares(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int id, int offset, int big)
{
gint size = (big)?10:6;
- const char *str_value = tvb_get_ephemeral_string(tvb, offset, size);
+ const char *str_value = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
guint32 value = (guint32)strtoul(str_value, NULL, 10);
@@ -209,7 +209,7 @@ price(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int id, i
{
gint size = (big)?19:10;
- const char *str_value = tvb_get_ephemeral_string(tvb, offset, size);
+ const char *str_value = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
gdouble value = guint64_to_gdouble(g_ascii_strtoull(str_value, NULL, 10))/((big)?1000000.0:10000.0);
proto_tree_add_double(nasdaq_itch_tree, id, tvb, offset, size, value);
@@ -222,7 +222,7 @@ price(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int id, i
static int
stock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int offset)
{
- char *stock_p = tvb_get_ephemeral_string(tvb, offset, 6);
+ char *stock_p = tvb_get_string(wmem_packet_scope(), tvb, offset, 6);
proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_stock, tvb, offset, 6, ENC_ASCII|ENC_NA);
col_append_fstr(pinfo->cinfo, COL_INFO, "<%s> ", stock_p);
diff --git a/epan/dissectors/packet-ndps.c b/epan/dissectors/packet-ndps.c
index e45d355bce..281f3c515e 100644
--- a/epan/dissectors/packet-ndps.c
+++ b/epan/dissectors/packet-ndps.c
@@ -2029,12 +2029,12 @@ ndps_string(tvbuff_t* tvb, int hfinfo, proto_tree *ndps_tree, int offset, char *
/*
* ASCII.
*/
- string = tvb_get_ephemeral_string(tvb, foffset, str_length);
+ string = tvb_get_string(wmem_packet_scope(), tvb, foffset, str_length);
} else {
/*
* Unicode.
*/
- string = tvb_get_ephemeral_unicode_string(tvb, foffset, str_length, ENC_LITTLE_ENDIAN);
+ string = tvb_get_unicode_string(wmem_packet_scope(), tvb, foffset, str_length, ENC_LITTLE_ENDIAN);
}
foffset += str_length;
proto_tree_add_string(ndps_tree, hfinfo, tvb, offset, str_length + 4, string);
diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c
index e5ad85b7a4..9cb2e36d2f 100644
--- a/epan/dissectors/packet-nfs.c
+++ b/epan/dissectors/packet-nfs.c
@@ -981,7 +981,7 @@ nfs_name_snoop_add_name(int xid, tvbuff_t *tvb, int name_offset, int name_len, i
if(parent_len){
nns->parent_len=parent_len;
- nns->parent=(unsigned char *)tvb_g_memdup(tvb, parent_offset, parent_len);
+ nns->parent=(unsigned char *)tvb_memdup(NULL, tvb, parent_offset, parent_len);
} else {
nns->parent_len=0;
nns->parent=NULL;
@@ -1042,7 +1042,7 @@ nfs_name_snoop_add_fh(int xid, tvbuff_t *tvb, int fh_offset, int fh_length)
}
/* oki, we have a new entry */
- fh=(unsigned char *)tvb_g_memdup(tvb, fh_offset, fh_length);
+ fh=(unsigned char *)tvb_memdup(NULL, tvb, fh_offset, fh_length);
nns->fh=fh;
nns->fh_length=fh_length;
@@ -1158,7 +1158,7 @@ nfs_name_snoop_fh(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int fh_of
fhlen=fh_length;
/* align it */
- fhdata=(guint32 *)tvb_g_memdup(tvb, fh_offset, fh_length);
+ fhdata=(guint32 *)tvb_memdup(NULL, tvb, fh_offset, fh_length);
fhkey[0].length=1;
fhkey[0].key=&fhlen;
fhkey[1].length=fhlen/4;
@@ -2321,7 +2321,7 @@ dissect_fhandle_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *
guint8 *fh_array;
proto_item *fh_item = NULL;
- fh_array = tvb_get_g_string(tvb, offset, fhlen);
+ fh_array = tvb_get_string(NULL, tvb, offset, fhlen);
fhhash = crc32_ccitt(fh_array, fhlen);
g_free(fh_array);
@@ -7963,7 +7963,7 @@ dissect_nfs4_stateid(tvbuff_t *tvb, int offset, proto_tree *tree, guint16 *hash)
newftree = proto_item_add_subtree(fitem, ett_nfs4_stateid);
}
- sidh_array = tvb_get_g_string(tvb, offset, 16);
+ sidh_array = tvb_get_string(NULL, tvb, offset, 16);
sid_hash = crc16_ccitt(sidh_array, 16);
g_free(sidh_array);
@@ -9146,7 +9146,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre
break;
case NFS4_OP_RENEW:
- clientid_array = tvb_get_ephemeral_string(tvb, offset, 8);
+ clientid_array = tvb_get_string(wmem_packet_scope(), tvb, offset, 8);
clientid_hash = crc16_ccitt(clientid_array, 8);
offset = dissect_rpc_uint64(tvb, newftree, hf_nfs4_clientid, offset);
g_string_append_printf (op_summary[ops_counter].optext, " CID: 0x%04x", clientid_hash);
diff --git a/epan/dissectors/packet-nlm.c b/epan/dissectors/packet-nlm.c
index 380b710aaa..f72c330d12 100644
--- a/epan/dissectors/packet-nlm.c
+++ b/epan/dissectors/packet-nlm.c
@@ -282,7 +282,7 @@ nlm_register_unmatched_msg(packet_info *pinfo, tvbuff_t *tvb, int offset)
umd->req_frame=pinfo->fd->num;
umd->ns=pinfo->fd->abs_ts;
umd->cookie_len=tvb_get_ntohl(tvb, offset);
- umd->cookie=(const guint8 *)tvb_g_memdup(tvb, offset+4, umd->cookie_len);
+ umd->cookie=(const guint8 *)tvb_memdup(NULL, tvb, offset+4, umd->cookie_len);
/* remove any old duplicates */
old_umd=(nlm_msg_res_unmatched_data *)g_hash_table_lookup(nlm_msg_res_unmatched, (gconstpointer)umd);
diff --git a/epan/dissectors/packet-ntlmssp.c b/epan/dissectors/packet-ntlmssp.c
index e49ed1d9c5..dbe0ace8bd 100644
--- a/epan/dissectors/packet-ntlmssp.c
+++ b/epan/dissectors/packet-ntlmssp.c
@@ -1295,7 +1295,7 @@ dissect_ntlmssp_target_info_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
case NTLM_TARGET_INFO_DNS_DOMAIN_NAME:
case NTLM_TARGET_INFO_DNS_TREE_NAME:
case NTLM_TARGET_INFO_TARGET_NAME:
- text = tvb_get_ephemeral_unicode_string(tvb, content_offset, content_length, ENC_LITTLE_ENDIAN);
+ text = tvb_get_unicode_string(wmem_packet_scope(), tvb, content_offset, content_length, ENC_LITTLE_ENDIAN);
proto_tree_add_string(target_info_tree, *hf_array_p[item_type], tvb, content_offset, content_length, text);
proto_item_append_text(target_info_tf, ": %s", text);
break;
@@ -2079,7 +2079,7 @@ decrypt_data_payload(tvbuff_t *tvb, int offset, guint32 encrypted_block_length,
/* Store the decrypted contents in the packet state struct
(of course at this point, they aren't decrypted yet) */
- packet_ntlmssp_info->decrypted_payload = (guint8 *)tvb_g_memdup(tvb, offset,
+ packet_ntlmssp_info->decrypted_payload = (guint8 *)tvb_memdup(NULL, tvb, offset,
encrypted_block_length);
packet_ntlmssp_info->payload_len = encrypted_block_length;
decrypted_payloads = g_slist_prepend(decrypted_payloads,
@@ -2589,7 +2589,7 @@ dissect_ntlmssp_encrypted_payload(tvbuff_t *data_tvb,
/* Store the decrypted contents in the packet state struct
(of course at this point, they aren't decrypted yet) */
- packet_ntlmssp_info->decrypted_payload = tvb_g_memdup(data_tvb, offset,
+ packet_ntlmssp_info->decrypted_payload = tvb_memdup(NULL, data_tvb, offset,
encrypted_block_length);
decrypted_payloads = g_slist_prepend(decrypted_payloads,
packet_ntlmssp_info->decrypted_payload);
diff --git a/epan/dissectors/packet-ntp.c b/epan/dissectors/packet-ntp.c
index a9fee7b227..a5d3abdee5 100644
--- a/epan/dissectors/packet-ntp.c
+++ b/epan/dissectors/packet-ntp.c
@@ -834,7 +834,7 @@ dissect_ntp_std(tvbuff_t *tvb, proto_tree *ntp_tree, guint8 flags)
buff = (gchar *)wmem_alloc(wmem_packet_scope(), NTP_TS_SIZE);
if (stratum <= 1) {
g_snprintf (buff, NTP_TS_SIZE, "Unidentified reference source '%.4s'",
- tvb_get_ephemeral_string(tvb, 12, 4));
+ tvb_get_string(wmem_packet_scope(), tvb, 12, 4));
for (i = 0; primary_sources[i].id; i++) {
if (tvb_memeql(tvb, 12, primary_sources[i].id, 4) == 0) {
g_snprintf(buff, NTP_TS_SIZE, "%s",
diff --git a/epan/dissectors/packet-opensafety.c b/epan/dissectors/packet-opensafety.c
index b1c21e2418..a3fbb46340 100644
--- a/epan/dissectors/packet-opensafety.c
+++ b/epan/dissectors/packet-opensafety.c
@@ -683,7 +683,7 @@ findFrame1Position ( tvbuff_t *message_tvb, guint16 byte_offset, guint8 dataLeng
else
frameCRC = tvb_get_guint8(message_tvb, byte_offset + i_wFrame1Position + dataLength + OSS_FRAME_POS_DATA);
- bytes = (guint8*)ep_tvb_memdup(message_tvb, byte_offset + i_wFrame1Position, dataLength + 4);
+ bytes = (guint8*)tvb_memdup(wmem_packet_scope(), message_tvb, byte_offset + i_wFrame1Position, dataLength + 4);
if ( dataLength > OSS_PAYLOAD_MAXSIZE_FOR_CRC8 )
{
calcCRC = crc16_0x755B(bytes, dataLength + 4, 0);
@@ -776,7 +776,7 @@ static guint8 findSafetyFrame ( tvbuff_t * message_tvb, guint u_Offset, gboolean
/* Find CRC position and calculate checksum */
crc = tvb_get_guint8(message_tvb, ctr + 3 + b_Length );
- bytes = (guint8 *)ep_tvb_memdup(message_tvb, ctr - 1, b_Length + 5 );
+ bytes = (guint8 *)tvb_memdup(wmem_packet_scope(), message_tvb, ctr - 1, b_Length + 5 );
if ( b_Length > 8 ) {
crc = tvb_get_letohs ( message_tvb, ctr + 3 + b_Length );
crcOffset = 1;
@@ -1626,7 +1626,7 @@ dissect_opensafety_checksum(tvbuff_t *message_tvb, packet_info *pinfo, proto_tre
checksum_tree = proto_item_add_subtree(item, ett_opensafety_checksum);
- bytes = (guint8*)ep_tvb_memdup(message_tvb, frameStart1, dataLength + 4);
+ bytes = (guint8*)tvb_memdup(wmem_packet_scope(), message_tvb, frameStart1, dataLength + 4);
if ( dataLength > OSS_PAYLOAD_MAXSIZE_FOR_CRC8 )
{
calc1_crc = crc16_0x755B(&bytes[frameStart1], dataLength + 4, 0);
diff --git a/epan/dissectors/packet-opsi.c b/epan/dissectors/packet-opsi.c
index 3c24876871..d7c2e21fb7 100644
--- a/epan/dissectors/packet-opsi.c
+++ b/epan/dissectors/packet-opsi.c
@@ -435,7 +435,7 @@ decode_string_attribute(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pro
return;
}
- pbuffer=tvb_get_ephemeral_string(tvb, offset+4, length-4);
+ pbuffer=tvb_get_string(wmem_packet_scope(), tvb, offset+4, length-4);
proto_tree_add_string(tree, *hfValue, tvb, offset+4, length-4, pbuffer);
}
diff --git a/epan/dissectors/packet-p_mul.c b/epan/dissectors/packet-p_mul.c
index 760ae0bfe6..f19d1ffcc1 100644
--- a/epan/dissectors/packet-p_mul.c
+++ b/epan/dissectors/packet-p_mul.c
@@ -915,7 +915,7 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
en = proto_tree_add_item (p_mul_tree, hf_checksum, tvb, offset, 2, ENC_BIG_ENDIAN);
checksum_tree = proto_item_add_subtree (en, ett_checksum);
len = tvb_length (tvb);
- value = tvb_get_ephemeral_string (tvb, 0, len);
+ value = tvb_get_string (wmem_packet_scope(), tvb, 0, len);
checksum1 = checksum (value, len, offset);
checksum2 = tvb_get_ntohs (tvb, offset);
if (checksum1 == checksum2) {
diff --git a/epan/dissectors/packet-pagp.c b/epan/dissectors/packet-pagp.c
index e0b13a845a..64f49fcb66 100644
--- a/epan/dissectors/packet-pagp.c
+++ b/epan/dissectors/packet-pagp.c
@@ -341,12 +341,12 @@ dissect_pagp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch (tlv) {
case PAGP_TLV_DEVICE_NAME:
- ch = tvb_get_ephemeral_string(tvb, offset+4, len-4);
+ ch = tvb_get_string(wmem_packet_scope(), tvb, offset+4, len-4);
proto_tree_add_string(tlv_tree, hf_pagp_tlv_device_name,
tvb, offset+4, len-4, ch);
break;
case PAGP_TLV_PORT_NAME:
- ch = tvb_get_ephemeral_string(tvb, offset+4, len-4);
+ ch = tvb_get_string(wmem_packet_scope(), tvb, offset+4, len-4);
proto_tree_add_string(tlv_tree, hf_pagp_tlv_port_name,
tvb, offset+4, len-4, ch);
break;
diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c
index 9ae7dd5362..1dbab8812e 100644
--- a/epan/dissectors/packet-per.c
+++ b/epan/dissectors/packet-per.c
@@ -814,7 +814,7 @@ dissect_per_BMPString(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tre
length=1024;
}
- str = tvb_get_ephemeral_unicode_string(tvb, offset>>3, length*2, ENC_BIG_ENDIAN);
+ str = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset>>3, length*2, ENC_BIG_ENDIAN);
proto_tree_add_string(tree, hf_index, tvb, offset>>3, length*2, str);
diff --git a/epan/dissectors/packet-pflog.c b/epan/dissectors/packet-pflog.c
index 108de3953c..771c413bdc 100644
--- a/epan/dissectors/packet-pflog.c
+++ b/epan/dissectors/packet-pflog.c
@@ -195,7 +195,7 @@ dissect_pflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 1;
proto_tree_add_item(pflog_tree, hf_pflog_ifname, tvb, offset, 16, ENC_ASCII|ENC_NA);
- ifname = tvb_get_ephemeral_string(tvb, offset, 16);
+ ifname = tvb_get_string(wmem_packet_scope(), tvb, offset, 16);
offset += 16;
proto_tree_add_item(pflog_tree, hf_pflog_ruleset, tvb, offset, 16, ENC_ASCII|ENC_NA);
@@ -434,7 +434,7 @@ dissect_old_pflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
if (tree) {
proto_tree_add_item(pflog_tree, hf_old_pflog_ifname, tvb, offset, 16, ENC_ASCII|ENC_NA);
}
- ifname = tvb_get_ephemeral_string(tvb, offset, 16);
+ ifname = tvb_get_string(wmem_packet_scope(), tvb, offset, 16);
offset +=16;
if (tree) {
diff --git a/epan/dissectors/packet-pkcs12.c b/epan/dissectors/packet-pkcs12.c
index f6a486eafd..b51be6eecc 100644
--- a/epan/dissectors/packet-pkcs12.c
+++ b/epan/dissectors/packet-pkcs12.c
@@ -203,7 +203,7 @@ generate_key_or_iv(unsigned int id, tvbuff_t *salt_tvb, unsigned int iter,
cur_keylen = 0;
salt_size = tvb_length(salt_tvb);
- salt_p = tvb_get_ephemeral_string(salt_tvb, 0, salt_size);
+ salt_p = tvb_get_string(wmem_packet_scope(), salt_tvb, 0, salt_size);
if (pw == NULL)
pwlen = 0;
@@ -399,7 +399,7 @@ int PBE_decrypt_data(const char *object_identifier_id_param, tvbuff_t *encrypted
datalen = tvb_length(encrypted_tvb);
clear_data = (char *)g_malloc(datalen);
- err = gcry_cipher_decrypt (cipher, clear_data, datalen, tvb_get_ephemeral_string(encrypted_tvb, 0, datalen), datalen);
+ err = gcry_cipher_decrypt (cipher, clear_data, datalen, tvb_get_string(wmem_packet_scope(), encrypted_tvb, 0, datalen), datalen);
if (gcry_err_code (err)) {
proto_item_append_text(item, " [Failed to decrypt with password preference]");
diff --git a/epan/dissectors/packet-pnrp.c b/epan/dissectors/packet-pnrp.c
index 194534a99e..05b65893d4 100644
--- a/epan/dissectors/packet-pnrp.c
+++ b/epan/dissectors/packet-pnrp.c
@@ -682,7 +682,7 @@ static int dissect_pnrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
/* Entry Length: Must be 0x0002 */
proto_tree_add_item(pnrp_message_tree, hf_pnrp_message_classifier_entryLength, tvb, offset + 10, 2, ENC_BIG_ENDIAN);
/* The actual classifier String */
- proto_tree_add_text(pnrp_message_tree, tvb, offset + 12, tvb_get_ntohs(tvb,offset+6)-8, "Classifier: %s",tvb_get_ephemeral_unicode_string(tvb, offset + 12, tvb_get_ntohs(tvb,offset+6)-8, ENC_BIG_ENDIAN));
+ proto_tree_add_text(pnrp_message_tree, tvb, offset + 12, tvb_get_ntohs(tvb,offset+6)-8, "Classifier: %s",tvb_get_unicode_string(wmem_packet_scope(), tvb, offset + 12, tvb_get_ntohs(tvb,offset+6)-8, ENC_BIG_ENDIAN));
}
/* There might be padding, so fill up to the next byte */
diff --git a/epan/dissectors/packet-ppcap.c b/epan/dissectors/packet-ppcap.c
index 5587d06f64..ac5711564b 100644
--- a/epan/dissectors/packet-ppcap.c
+++ b/epan/dissectors/packet-ppcap.c
@@ -184,7 +184,7 @@ static int
dissect_ppcap_payload_type(tvbuff_t *tvb, proto_tree * ppcap_tree1, int offset, guint16 msg_len, payload_type_type *payload_type)
{
char *string;
- string = tvb_get_ephemeral_string(tvb, offset, msg_len);
+ string = tvb_get_string(wmem_packet_scope(), tvb, offset, msg_len);
if (strcmp(string,"mtp3") == 0) {
*payload_type = PPCAP_MTP3;
@@ -375,7 +375,7 @@ dissect_ppcap_destination_address(tvbuff_t *tvb, packet_info * pinfo, proto_tree
else if (key2 == 4)
{
char *string;
- string = tvb_get_g_string(tvb, offset, msg_len);
+ string = tvb_get_string(wmem_packet_scope(), tvb, offset, msg_len);
proto_tree_add_string(ppcap_tree1, hf_ppcap_destination_nodeid, tvb, offset, msg_len, string);
TVB_SET_ADDRESS(&pinfo->net_dst, AT_STRINGZ, tvb, offset, msg_len);
COPY_ADDRESS_SHALLOW(&pinfo->dst, &pinfo->net_dst);
diff --git a/epan/dissectors/packet-ppp.c b/epan/dissectors/packet-ppp.c
index 816fc4d814..d1a9b6c215 100644
--- a/epan/dissectors/packet-ppp.c
+++ b/epan/dissectors/packet-ppp.c
@@ -4604,7 +4604,7 @@ dissect_iphc_crtp_fh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb_ensure_bytes_exist (tvb, 0, hdr_len); /* ip_hdr_len + 8 */
/* allocate a copy of the IP packet */
- ip_packet = (guchar *)tvb_g_memdup(tvb, 0, length);
+ ip_packet = (guchar *)tvb_memdup(NULL, tvb, 0, length);
/* restore the proper values to the IP and UDP length fields */
ip_packet[2] = length >> 8;
diff --git a/epan/dissectors/packet-pppoe.c b/epan/dissectors/packet-pppoe.c
index 83301e5474..e24d8ec628 100644
--- a/epan/dissectors/packet-pppoe.c
+++ b/epan/dissectors/packet-pppoe.c
@@ -485,7 +485,7 @@ dissect_pppoe_tags(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tr
tagstart+4, poe_tag_length, ENC_ASCII|ENC_NA);
/* Show AC-Name in info column */
col_append_fstr(pinfo->cinfo, COL_INFO, " AC-Name='%s'",
- tvb_get_ephemeral_string(tvb, tagstart+4, poe_tag_length));
+ tvb_get_string(wmem_packet_scope(), tvb, tagstart+4, poe_tag_length));
break;
case PPPOE_TAG_HOST_UNIQ:
proto_tree_add_item(pppoe_tree, hf_pppoed_tag_host_uniq, tvb,
diff --git a/epan/dissectors/packet-ptpip.c b/epan/dissectors/packet-ptpip.c
index 48db836acb..c1106ef897 100644
--- a/epan/dissectors/packet-ptpip.c
+++ b/epan/dissectors/packet-ptpip.c
@@ -515,7 +515,7 @@ void dissect_ptpIP_unicode_name(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
gint nameLen;
nameLen = tvb_unicode_strsize(tvb, *offset);
- name = tvb_get_ephemeral_unicode_string(tvb, *offset, nameLen, ENC_LITTLE_ENDIAN);
+ name = tvb_get_unicode_string(wmem_packet_scope(), tvb, *offset, nameLen, ENC_LITTLE_ENDIAN);
proto_tree_add_unicode_string(tree, hf_ptpIP_name, tvb, *offset, nameLen, name);
*offset+=nameLen;
col_append_fstr(
diff --git a/epan/dissectors/packet-pvfs2.c b/epan/dissectors/packet-pvfs2.c
index b7936123cb..a4314f0a8c 100644
--- a/epan/dissectors/packet-pvfs2.c
+++ b/epan/dissectors/packet-pvfs2.c
@@ -870,7 +870,7 @@ dissect_pvfs_opaque_data(tvbuff_t *tvb, int offset,
if (string_data) {
char *tmpstr;
- tmpstr = (char *) tvb_get_ephemeral_string(tvb, data_offset,
+ tmpstr = (char *) tvb_get_string(wmem_packet_scope(), tvb, data_offset,
string_length_copy);
string_buffer = (char *)memcpy(wmem_alloc(wmem_packet_scope(), string_length_copy+1), tmpstr, string_length_copy);
@@ -1182,7 +1182,7 @@ dissect_pvfs_distribution(tvbuff_t *tvb, proto_tree *tree, int offset)
distlen = tvb_get_letohl(tvb, offset);
/* Get distribution name */
- tmpstr = (char *) tvb_get_ephemeral_string(tvb, offset + 4, distlen);
+ tmpstr = (char *) tvb_get_string(wmem_packet_scope(), tvb, offset + 4, distlen);
if (tree)
{
diff --git a/epan/dissectors/packet-q2931.c b/epan/dissectors/packet-q2931.c
index 34f2909d55..5577f8764c 100644
--- a/epan/dissectors/packet-q2931.c
+++ b/epan/dissectors/packet-q2931.c
@@ -1295,7 +1295,7 @@ dissect_q2931_cause_ie(tvbuff_t *tvb, int offset, int len,
if (len < 3)
return;
proto_tree_add_text(tree, tvb, offset, 3,
- "Timer: %.3s", tvb_get_ephemeral_string(tvb, offset, 3));
+ "Timer: %.3s", tvb_get_string(wmem_packet_scope(), tvb, offset, 3));
break;
default:
@@ -1430,7 +1430,7 @@ dissect_q2931_number_ie(tvbuff_t *tvb, int offset, int len,
case Q2931_ISDN_NUMBERING:
proto_tree_add_text(tree, tvb, offset, len, "Number: %.*s",
- len, tvb_get_ephemeral_string(tvb, offset, len));
+ len, tvb_get_string(wmem_packet_scope(), tvb, offset, len));
break;
case Q2931_NSAP_ADDRESSING:
@@ -1734,7 +1734,7 @@ dissect_q2931_transit_network_sel_ie(tvbuff_t *tvb, int offset, int len,
if (len == 0)
return;
proto_tree_add_text(tree, tvb, offset, len,
- "Network identification: %.*s", len, tvb_get_ephemeral_string(tvb, offset, len));
+ "Network identification: %.*s", len, tvb_get_string(wmem_packet_scope(), tvb, offset, len));
}
/*
diff --git a/epan/dissectors/packet-q931.c b/epan/dissectors/packet-q931.c
index 8df37df250..b1fa92a732 100644
--- a/epan/dissectors/packet-q931.c
+++ b/epan/dissectors/packet-q931.c
@@ -1399,7 +1399,7 @@ dissect_q931_cause_ie_unsafe(tvbuff_t *tvb, int offset, int len,
if (len < 3)
return;
proto_tree_add_text(tree, tvb, offset, 3,
- "Timer: %.3s", tvb_get_ephemeral_string(tvb, offset, 3));
+ "Timer: %.3s", tvb_get_string(wmem_packet_scope(), tvb, offset, 3));
break;
default:
@@ -2239,7 +2239,7 @@ dissect_q931_number_ie(tvbuff_t *tvb, int offset, int len,
if ( number_plan == 1 ) {
if ( e164_info.e164_number_type != NONE ){
- e164_info.E164_number_str = tvb_get_ephemeral_string(tvb, offset, len);
+ e164_info.E164_number_str = tvb_get_string(wmem_packet_scope(), tvb, offset, len);
e164_info.E164_number_length = len;
dissect_e164_number(tvb, tree, offset, len, e164_info);
}
@@ -2247,9 +2247,9 @@ dissect_q931_number_ie(tvbuff_t *tvb, int offset, int len,
/* Collect q931_packet_info */
if ( e164_info.e164_number_type == CALLING_PARTY_NUMBER && have_valid_q931_pi)
- q931_pi->calling_number = tvb_get_ephemeral_string(tvb, offset, len);
+ q931_pi->calling_number = tvb_get_string(wmem_packet_scope(), tvb, offset, len);
if ( e164_info.e164_number_type == CALLED_PARTY_NUMBER && have_valid_q931_pi)
- q931_pi->called_number = tvb_get_ephemeral_string(tvb, offset, len);
+ q931_pi->called_number = tvb_get_string(wmem_packet_scope(), tvb, offset, len);
}
/*
diff --git a/epan/dissectors/packet-q933.c b/epan/dissectors/packet-q933.c
index 31cbb47269..5e3f1ebe84 100644
--- a/epan/dissectors/packet-q933.c
+++ b/epan/dissectors/packet-q933.c
@@ -1030,7 +1030,7 @@ dissect_q933_cause_ie(tvbuff_t *tvb, int offset, int len,
if (len < 3)
return;
proto_tree_add_text(tree, tvb, offset, 3,
- "Timer: %.3s", tvb_get_ephemeral_string(tvb, offset, 3));
+ "Timer: %.3s", tvb_get_string(wmem_packet_scope(), tvb, offset, 3));
break;
default:
diff --git a/epan/dissectors/packet-quake2.c b/epan/dissectors/packet-quake2.c
index a4e277d62f..829cb5a877 100644
--- a/epan/dissectors/packet-quake2.c
+++ b/epan/dissectors/packet-quake2.c
@@ -110,7 +110,7 @@ dissect_quake2_ConnectionlessPacket(tvbuff_t *tvb, packet_info *pinfo _U_,
len = tvb_length_remaining(tvb, offset);
if (cl_tree) {
- text = tvb_get_ephemeral_string(tvb, offset, len);
+ text = tvb_get_string(wmem_packet_scope(), tvb, offset, len);
proto_tree_add_string(cl_tree, hf_quake2_connectionless_text,
tvb, offset, len, text);
}
@@ -344,7 +344,7 @@ dissect_quake2_client_commands_uinfo(tvbuff_t *tvb, packet_info *pinfo _U_,
if (tree) {
proto_tree_add_text(tree, tvb, 0, len, "Userinfo: %s",
- tvb_get_ephemeral_string(tvb, 0, len));
+ tvb_get_string(wmem_packet_scope(), tvb, 0, len));
}
return len;
@@ -360,7 +360,7 @@ dissect_quake2_client_commands_stringcmd(tvbuff_t *tvb, packet_info *pinfo _U_,
if (tree) {
proto_tree_add_text(tree, tvb, 0, len, "Command: %s",
- tvb_get_ephemeral_string(tvb, 0, len));
+ tvb_get_string(wmem_packet_scope(), tvb, 0, len));
}
return len;
diff --git a/epan/dissectors/packet-ranap.c b/epan/dissectors/packet-ranap.c
index d505ccb869..621132b075 100644
--- a/epan/dissectors/packet-ranap.c
+++ b/epan/dissectors/packet-ranap.c
@@ -4776,7 +4776,7 @@ dissect_ranap_IMSI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, prot
&& ! actx->pinfo->sccp_info->data.co.assoc->calling_party ) {
guint len = tvb_length(imsi_tvb);
- guint8* bytes = (guint8 *)ep_tvb_memdup(imsi_tvb,0,len);
+ guint8* bytes = (guint8 *)tvb_memdup(wmem_packet_scope(),imsi_tvb,0,len);
actx->pinfo->sccp_info->data.co.assoc->calling_party =
wmem_strdup_printf(wmem_file_scope(), "IMSI: %s", bytes_to_str(bytes, len) );
diff --git a/epan/dissectors/packet-rdp.c b/epan/dissectors/packet-rdp.c
index 5eac0edeee..5d3ea91ee8 100644
--- a/epan/dissectors/packet-rdp.c
+++ b/epan/dissectors/packet-rdp.c
@@ -842,7 +842,7 @@ dissect_rdp_fields(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tr
pi = proto_tree_add_item(tree, c->field, tvb, offset, len, ENC_LITTLE_ENDIAN);
if (c->flags & RDP_FI_UNICODE) {
- string = tvb_get_ephemeral_unicode_string(tvb, offset, len, ENC_LITTLE_ENDIAN);
+ string = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, len, ENC_LITTLE_ENDIAN);
proto_item_append_text(pi, " (%s)", string);
}
@@ -957,7 +957,7 @@ dissect_rdp_clientNetworkData(tvbuff_t *tvb, int offset, packet_info *pinfo, pro
for (i = 0; i < MIN(channelCount, MAX_CHANNELS); i++) {
if (rdp_info) {
rdp_info->channels[i].value = -1; /* unset */
- rdp_info->channels[i].strptr = tvb_get_ephemeral_string(tvb, offset, 8);
+ rdp_info->channels[i].strptr = tvb_get_string(wmem_packet_scope(), tvb, offset, 8);
}
offset = dissect_rdp_fields(tvb, offset, pinfo, next_tree, def_fields, 0);
}
diff --git a/epan/dissectors/packet-reload.c b/epan/dissectors/packet-reload.c
index e07070f77e..6f64f9df33 100644
--- a/epan/dissectors/packet-reload.c
+++ b/epan/dissectors/packet-reload.c
@@ -3827,7 +3827,7 @@ extern gint dissect_reload_messagecontents(tvbuff_t *tvb, packet_info *pinfo, pr
if (error_code <= 19) {
guint16 info_length = tvb_get_ntohs(tvb,offset+2);
if (info_length>0) {
- proto_item_append_text(ti_error, " (%s)", tvb_get_ephemeral_string(tvb, offset+4, info_length));
+ proto_item_append_text(ti_error, " (%s)", tvb_get_string(wmem_packet_scope(), tvb, offset+4, info_length));
}
}
break;
diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c
index eb7d340392..c40731a57a 100644
--- a/epan/dissectors/packet-rpc.c
+++ b/epan/dissectors/packet-rpc.c
@@ -637,7 +637,7 @@ dissect_rpc_opaque_data(tvbuff_t *tvb, int offset,
}
if (string_data) {
- string_buffer = tvb_get_ephemeral_string(tvb, data_offset, string_length_copy);
+ string_buffer = tvb_get_string(wmem_packet_scope(), tvb, data_offset, string_length_copy);
} else {
string_buffer = (char *)tvb_memcpy(tvb, wmem_alloc(wmem_packet_scope(), string_length_copy+1), data_offset, string_length_copy);
}
diff --git a/epan/dissectors/packet-rpcap.c b/epan/dissectors/packet-rpcap.c
index 35c8131fc8..78b0c88369 100644
--- a/epan/dissectors/packet-rpcap.c
+++ b/epan/dissectors/packet-rpcap.c
@@ -500,7 +500,7 @@ dissect_rpcap_findalldevs_if (tvbuff_t *tvb, packet_info *pinfo _U_,
offset += 2;
if (namelen) {
- proto_item_append_text (ti, ": %s", tvb_get_ephemeral_string (tvb, offset, namelen));
+ proto_item_append_text (ti, ": %s", tvb_get_string (wmem_packet_scope(), tvb, offset, namelen));
proto_tree_add_item (tree, hf_if_name, tvb, offset, namelen, ENC_ASCII|ENC_NA);
offset += namelen;
}
@@ -667,11 +667,11 @@ dissect_rpcap_auth_request (tvbuff_t *tvb, packet_info *pinfo _U_,
} else if (type == RPCAP_RMTAUTH_PWD) {
guint8 *username, *password;
- username = tvb_get_ephemeral_string (tvb, offset, slen1);
+ username = tvb_get_string (wmem_packet_scope(), tvb, offset, slen1);
proto_tree_add_item (tree, hf_auth_username, tvb, offset, slen1, ENC_ASCII|ENC_NA);
offset += slen1;
- password = tvb_get_ephemeral_string (tvb, offset, slen2);
+ password = tvb_get_string (wmem_packet_scope(), tvb, offset, slen2);
proto_tree_add_item (tree, hf_auth_password, tvb, offset, slen2, ENC_ASCII|ENC_NA);
offset += slen2;
diff --git a/epan/dissectors/packet-rrc.c b/epan/dissectors/packet-rrc.c
index 776fc41be1..4544ac983b 100644
--- a/epan/dissectors/packet-rrc.c
+++ b/epan/dissectors/packet-rrc.c
@@ -132868,7 +132868,7 @@ dissect_rrc_HNBName(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, pro
1, maxHNBNameSize, FALSE, &hnbname_tvb);
actx->created_item = proto_tree_add_unicode_string(tree, hf_index, hnbname_tvb, 0, -1,
- tvb_get_ephemeral_string_enc(hnbname_tvb, 0, tvb_length(hnbname_tvb), ENC_UTF_8 | ENC_NA));
+ tvb_get_string_enc(wmem_packet_scope(), hnbname_tvb, 0, tvb_length(hnbname_tvb), ENC_UTF_8 | ENC_NA));
diff --git a/epan/dissectors/packet-rsvp.c b/epan/dissectors/packet-rsvp.c
index 468e37df1d..9acfe506d7 100644
--- a/epan/dissectors/packet-rsvp.c
+++ b/epan/dissectors/packet-rsvp.c
@@ -6068,12 +6068,12 @@ dissect_rsvp_call_id(proto_tree *ti, proto_tree *rsvp_object_tree,
"C-type: 2 (globally unique)");
proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, "Address type: %s",
val_to_str_ext(type, &address_type_vals_ext, "Unknown (%u)"));
- str = tvb_get_ephemeral_string (tvb, offset2 + 1, 3);
+ str = tvb_get_string (wmem_packet_scope(), tvb, offset2 + 1, 3);
proto_tree_add_text(rsvp_object_tree, tvb, offset2 + 1, 3,
"International Segment: %s", str);
proto_item_append_text(ti, "Globally-Unique. Addr Type: %s. Intl Segment: %s. ",
val_to_str_ext(type, &address_type_vals_ext, "Unknown (%u)"), str);
- str = tvb_get_ephemeral_string (tvb, offset2 + 4, 12);
+ str = tvb_get_string (wmem_packet_scope(), tvb, offset2 + 4, 12);
proto_tree_add_text(rsvp_object_tree, tvb, offset2 + 4, 12,
"National Segment: %s", str);
proto_item_append_text(ti, "Natl Segment: %s. ", str);
diff --git a/epan/dissectors/packet-rtcp.c b/epan/dissectors/packet-rtcp.c
index 2ce8902391..9a79b70176 100644
--- a/epan/dissectors/packet-rtcp.c
+++ b/epan/dissectors/packet-rtcp.c
@@ -1243,7 +1243,7 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree
offset++;
col_append_fstr(pinfo->cinfo, COL_INFO, " CNAME=\"%s\"",
- tvb_get_ephemeral_string(tvb, offset, item_len));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, item_len));
offset += item_len;
packet_len = packet_len - item_len - 1;
@@ -1274,7 +1274,7 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree
offset++;
col_append_fstr(pinfo->cinfo, COL_INFO, " DISPLAY-NAME=\"%s\"",
- tvb_get_ephemeral_string(tvb, offset, item_len));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, item_len));
offset += item_len;
packet_len = packet_len - item_len - 1;
@@ -1637,7 +1637,7 @@ dissect_rtcp_bye( tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tre
offset++;
reason_offset = offset;
- reason_text = (char*)tvb_get_ephemeral_string(tvb, offset, reason_length);
+ reason_text = (char*)tvb_get_string(wmem_packet_scope(), tvb, offset, reason_length);
proto_tree_add_string( tree, hf_rtcp_sdes_text, tvb, offset, reason_length, reason_text );
offset += reason_length;
}
diff --git a/epan/dissectors/packet-rtmpt.c b/epan/dissectors/packet-rtmpt.c
index 56b0445b2f..9603fd90ad 100644
--- a/epan/dissectors/packet-rtmpt.c
+++ b/epan/dissectors/packet-rtmpt.c
@@ -642,7 +642,7 @@ rtmpt_get_amf_param(tvbuff_t *tvb, gint offset, gint param, const gchar *prop)
if (!prop && iObjType==AMF0_STRING && remain>=3) {
iStringLength = tvb_get_ntohs(tvb, offset+1);
if (remain>=iStringLength+3) {
- return tvb_get_ephemeral_string(tvb, offset+3, iStringLength);
+ return tvb_get_string(wmem_packet_scope(), tvb, offset+3, iStringLength);
}
}
@@ -660,7 +660,7 @@ rtmpt_get_amf_param(tvbuff_t *tvb, gint offset, gint param, const gchar *prop)
iStringLength = tvb_get_ntohs(tvb, offset+2+iPropLength+1);
if (remain<2+iPropLength+3+iStringLength) break;
- return tvb_get_ephemeral_string(tvb, offset+2+iPropLength+3, iStringLength);
+ return tvb_get_string(wmem_packet_scope(), tvb, offset+2+iPropLength+3, iStringLength);
}
itemlen = rtmpt_get_amf_length(tvb, offset+2+iPropLength);
@@ -761,7 +761,7 @@ rtmpt_get_packet_desc(tvbuff_t *tvb, guint32 offset, guint32 remain, rtmpt_conv_
slen = tvb_get_ntohs(tvb, offset+1+soff);
}
if (slen>0) {
- sFunc = tvb_get_ephemeral_string(tvb, offset+3+soff, slen);
+ sFunc = tvb_get_string(wmem_packet_scope(), tvb, offset+3+soff, slen);
RTMPT_DEBUG("got function call '%s'\n", sFunc);
if (strcmp(sFunc, "connect")==0) {
@@ -873,7 +873,7 @@ dissect_amf0_property_list(tvbuff_t *tvb, gint offset, proto_tree *tree, guint *
tvb_get_guint8(tvb, offset + 2) == AMF0_END_OF_OBJECT)
break;
count++;
- iStringValue = tvb_get_ephemeral_string(tvb, offset + 2, iStringLength);
+ iStringValue = tvb_get_string(wmem_packet_scope(), tvb, offset + 2, iStringLength);
prop_ti = proto_tree_add_text(tree, tvb, offset, -1,
"Property '%s'",
iStringValue);
@@ -984,7 +984,7 @@ dissect_amf0_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, gboolean *
iStringLength = tvb_get_ntohs(tvb, iValueOffset);
proto_tree_add_uint(val_tree, hf_amf_stringlength, tvb, iValueOffset, 2, iStringLength);
iValueOffset += 2;
- iStringValue = tvb_get_ephemeral_string_enc(tvb, iValueOffset, iStringLength, ENC_UTF_8|ENC_NA);
+ iStringValue = tvb_get_string_enc(wmem_packet_scope(), tvb, iValueOffset, iStringLength, ENC_UTF_8|ENC_NA);
if (iStringLength != 0)
proto_tree_add_string(val_tree, hf_amf_string, tvb, iValueOffset, iStringLength, iStringValue);
iValueOffset += iStringLength;
@@ -1058,7 +1058,7 @@ dissect_amf0_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, gboolean *
iStringLength = tvb_get_ntohl(tvb, iValueOffset);
proto_tree_add_uint(val_tree, hf_amf_stringlength, tvb, iValueOffset, 2, iStringLength);
iValueOffset += 4;
- iStringValue = tvb_get_ephemeral_string_enc(tvb, iValueOffset, iStringLength, ENC_UTF_8|ENC_NA);
+ iStringValue = tvb_get_string_enc(wmem_packet_scope(), tvb, iValueOffset, iStringLength, ENC_UTF_8|ENC_NA);
if (iStringLength != 0)
proto_tree_add_string(val_tree, (iObjType==AMF0_XML) ? hf_amf_xml_doc : hf_amf_longstring, tvb, iValueOffset, iStringLength, iStringValue);
iValueOffset += iStringLength;
@@ -1073,7 +1073,7 @@ dissect_amf0_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, gboolean *
iStringLength = tvb_get_ntohs(tvb, iValueOffset);
proto_tree_add_uint(val_tree, hf_amf_stringlength, tvb, iValueOffset, 2, iStringLength);
iValueOffset += 2;
- iStringValue = tvb_get_ephemeral_string_enc(tvb, iValueOffset, iStringLength, ENC_UTF_8|ENC_NA);
+ iStringValue = tvb_get_string_enc(wmem_packet_scope(), tvb, iValueOffset, iStringLength, ENC_UTF_8|ENC_NA);
proto_tree_add_string(val_tree, hf_amf_string, tvb, iValueOffset, iStringLength, iStringValue);
iValueOffset += iStringLength;
iValueOffset = dissect_amf0_property_list(tvb, iValueOffset, val_tree, &count, amf3_encoding);
@@ -1240,7 +1240,7 @@ dissect_amf3_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, proto_item
iStringLength = iIntegerValue >> 1;
proto_tree_add_uint(val_tree, hf_amf_stringlength, tvb, iValueOffset, iValueLength, iStringLength);
iValueOffset += iValueLength;
- iStringValue = tvb_get_ephemeral_string_enc(tvb, iValueOffset, iStringLength, ENC_UTF_8|ENC_NA);
+ iStringValue = tvb_get_string_enc(wmem_packet_scope(), tvb, iValueOffset, iStringLength, ENC_UTF_8|ENC_NA);
if (iStringLength != 0)
proto_tree_add_string(val_tree, hf_amf_string, tvb, iValueOffset, iStringLength, iStringValue);
iValueOffset += iStringLength;
@@ -1318,7 +1318,7 @@ dissect_amf3_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, proto_item
iValueOffset += iValueLength;
break;
}
- iStringValue = tvb_get_ephemeral_string_enc(tvb, iValueOffset+iValueLength, iStringLength, ENC_UTF_8|ENC_NA);
+ iStringValue = tvb_get_string_enc(wmem_packet_scope(), tvb, iValueOffset+iValueLength, iStringLength, ENC_UTF_8|ENC_NA);
subval_ti = proto_tree_add_text(val_tree, tvb, iValueOffset, iStringLength, "%s:", iStringValue);
subval_tree = proto_item_add_subtree(subval_ti, ett_amf_array_element);
proto_tree_add_uint(subval_tree, hf_amf_stringlength, tvb, iValueOffset, iValueLength, iStringLength);
@@ -1383,7 +1383,7 @@ dissect_amf3_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, proto_item
if (iIntegerValue & 0x00000001) {
/* the upper 28 bits of the integer value is a string length */
iStringLength = iIntegerValue >> 1;
- iStringValue = tvb_get_ephemeral_string_enc(tvb, iValueOffset+iValueLength, iStringLength, ENC_UTF_8|ENC_NA);
+ iStringValue = tvb_get_string_enc(wmem_packet_scope(), tvb, iValueOffset+iValueLength, iStringLength, ENC_UTF_8|ENC_NA);
traits_ti = proto_tree_add_text(val_tree, tvb, iValueOffset, -1, "Traits for class %s (%u member names)", iStringValue, iTraitCount);
traits_tree = proto_item_add_subtree(traits_ti, ett_amf_traits);
name_ti = proto_tree_add_text(traits_tree, tvb,
@@ -1408,7 +1408,7 @@ dissect_amf3_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, proto_item
if (iIntegerValue & 0x00000001) {
/* the upper 28 bits of the integer value is a string length */
iStringLength = iIntegerValue >> 1;
- iStringValue = tvb_get_ephemeral_string_enc(tvb, iValueOffset+iValueLength, iStringLength, ENC_UTF_8|ENC_NA);
+ iStringValue = tvb_get_string_enc(wmem_packet_scope(), tvb, iValueOffset+iValueLength, iStringLength, ENC_UTF_8|ENC_NA);
member_ti = proto_tree_add_text(traits_tree, tvb, iValueOffset, iValueLength+iStringLength, "Member '%s'", iStringValue);
member_tree = proto_item_add_subtree(member_ti, ett_amf_trait_member);
proto_tree_add_uint(member_tree, hf_amf_membernamelength, tvb, iValueOffset, iValueLength, iStringLength);
@@ -1436,7 +1436,7 @@ dissect_amf3_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, proto_item
iValueOffset += iValueLength;
break;
}
- iStringValue = tvb_get_ephemeral_string_enc(tvb, iValueOffset+iValueLength, iStringLength, ENC_UTF_8|ENC_NA);
+ iStringValue = tvb_get_string_enc(wmem_packet_scope(), tvb, iValueOffset+iValueLength, iStringLength, ENC_UTF_8|ENC_NA);
subval_ti = proto_tree_add_text(traits_tree, tvb, iValueOffset, -1, "%s:", iStringValue);
subval_tree = proto_item_add_subtree(subval_ti, ett_amf_array_element);
name_ti = proto_tree_add_text(subval_tree, tvb,
@@ -1515,7 +1515,7 @@ dissect_amf3_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, proto_item
iArrayLength = iIntegerValue >> 1;
proto_tree_add_uint(val_tree, hf_amf_bytearraylength, tvb, iValueOffset, iValueLength, iArrayLength);
iValueOffset += iValueLength;
- iByteArrayValue = (guint8 *)ep_tvb_memdup(tvb, iValueOffset, iArrayLength);
+ iByteArrayValue = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, iValueOffset, iArrayLength);
proto_tree_add_bytes(val_tree, hf_amf_bytearray, tvb, iValueOffset, iArrayLength, iByteArrayValue);
proto_item_append_text(ti, " %s", bytes_to_str(iByteArrayValue, iArrayLength));
if (parent_ti != NULL)
diff --git a/epan/dissectors/packet-rtpproxy.c b/epan/dissectors/packet-rtpproxy.c
index 7148d5885e..d2f13e0291 100644
--- a/epan/dissectors/packet-rtpproxy.c
+++ b/epan/dissectors/packet-rtpproxy.c
@@ -189,7 +189,7 @@ dissect_rtpproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTPproxy (no LF)");
/* Get payload string */
- rawstr = tvb_get_ephemeral_string(tvb, offset, realsize - offset);
+ rawstr = tvb_get_string(wmem_packet_scope(), tvb, offset, realsize - offset);
/* Extract command */
tmp = g_ascii_tolower(tvb_get_guint8(tvb, offset));
diff --git a/epan/dissectors/packet-rtps.c b/epan/dissectors/packet-rtps.c
index 21c09ee68f..cb45a9c780 100644
--- a/epan/dissectors/packet-rtps.c
+++ b/epan/dissectors/packet-rtps.c
@@ -1478,7 +1478,7 @@ gint rtps_util_add_string(proto_tree *tree, tvbuff_t* tvb, gint offset,
guint32 size = NEXT_guint32(tvb, offset, little_endian);
if (size > 0) {
- retVal = tvb_get_ephemeral_string(tvb, offset+4, size);
+ retVal = tvb_get_string(wmem_packet_scope(), tvb, offset+4, size);
}
proto_tree_add_string(tree, hf_item, tvb, offset, size+4,
@@ -1580,7 +1580,7 @@ gint rtps_util_add_seq_string(proto_tree *tree, tvbuff_t* tvb, gint offset,
size = NEXT_guint32(tvb, offset, little_endian);
if (size > 0) {
- retVal = tvb_get_ephemeral_string(tvb, offset+4, size);
+ retVal = tvb_get_string(wmem_packet_scope(), tvb, offset+4, size);
} else {
retVal = (guint8 *)"";
}
@@ -1783,7 +1783,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t * tvb, gint offset
/* Get structure name length */
struct_name_len = NEXT_guint32(tvb, offset, little_endian);
offset += 4;
- struct_name = tvb_get_ephemeral_string(tvb, offset, struct_name_len);
+ struct_name = tvb_get_string(wmem_packet_scope(), tvb, offset, struct_name_len);
offset += struct_name_len;
/* - - - - - - - Default index - - - - - - - */
@@ -1805,7 +1805,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t * tvb, gint offset
/* Enums has also a name that we should print */
LONG_ALIGN(offset);
discriminator_enum_name_length = NEXT_guint32(tvb, offset, little_endian);
- discriminator_enum_name = tvb_get_ephemeral_string(tvb, offset+4, discriminator_enum_name_length);
+ discriminator_enum_name = tvb_get_string(wmem_packet_scope(), tvb, offset+4, discriminator_enum_name_length);
}
offset = disc_offset_begin + disc_size;
#if 0
@@ -1864,7 +1864,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t * tvb, gint offset
offset += 4;
/* Name */
- member_name = tvb_get_ephemeral_string(tvb, offset, member_name_len);
+ member_name = tvb_get_string(wmem_packet_scope(), tvb, offset, member_name_len);
offset += member_name_len;
/* is Pointer ? */
@@ -1962,7 +1962,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t * tvb, gint offset
offset += 4;
/* struct name */
- struct_name = tvb_get_ephemeral_string(tvb, offset, struct_name_len);
+ struct_name = tvb_get_string(wmem_packet_scope(), tvb, offset, struct_name_len);
offset += struct_name_len;
@@ -2006,7 +2006,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t * tvb, gint offset
offset += 4;
/* Name */
- member_name = tvb_get_ephemeral_string(tvb, offset, member_name_len);
+ member_name = tvb_get_string(wmem_packet_scope(), tvb, offset, member_name_len);
offset += member_name_len;
if (tk_id == RTI_CDR_TK_ENUM) {
@@ -2129,7 +2129,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t * tvb, gint offset
LONG_ALIGN(offset);
alias_name_length = NEXT_guint32(tvb, offset, little_endian);
offset += 4;
- alias_name = tvb_get_ephemeral_string(tvb, offset, alias_name_length);
+ alias_name = tvb_get_string(wmem_packet_scope(), tvb, offset, alias_name_length);
offset += alias_name_length;
g_strlcpy(type_name, alias_name, 40);
break;
@@ -2158,7 +2158,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t * tvb, gint offset
offset += 4;
/* value name */
- value_name = tvb_get_ephemeral_string(tvb, offset, value_name_len);
+ value_name = tvb_get_string(wmem_packet_scope(), tvb, offset, value_name_len);
offset += value_name_len;
g_snprintf(type_name, 40, "valuetype %s", value_name);
@@ -3168,7 +3168,7 @@ static gboolean dissect_parameter_sequence_v1(proto_tree *rtps_parameter_tree, p
prev_offset = temp_offset;
prop_size = NEXT_guint32(tvb, temp_offset, little_endian);
if (prop_size > 0) {
- propName = tvb_get_ephemeral_string(tvb, temp_offset+4, prop_size);
+ propName = tvb_get_string(wmem_packet_scope(), tvb, temp_offset+4, prop_size);
} else {
propName = (guint8 *)"";
}
@@ -3177,7 +3177,7 @@ static gboolean dissect_parameter_sequence_v1(proto_tree *rtps_parameter_tree, p
prop_size = NEXT_guint32(tvb, temp_offset, little_endian);
if (prop_size > 0) {
- propValue = tvb_get_ephemeral_string(tvb, temp_offset+4, prop_size);
+ propValue = tvb_get_string(wmem_packet_scope(), tvb, temp_offset+4, prop_size);
} else {
propValue = (guint8 *)"";
}
diff --git a/epan/dissectors/packet-rtsp.c b/epan/dissectors/packet-rtsp.c
index 3db9b36cd4..cf110b820f 100644
--- a/epan/dissectors/packet-rtsp.c
+++ b/epan/dissectors/packet-rtsp.c
@@ -1062,7 +1062,7 @@ dissect_rtspmessage(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
media_type_str_lower_case = ascii_strdown_inplace(
- (gchar *)tvb_get_ephemeral_string(tvb, offset, value_len));
+ (gchar *)tvb_get_string(wmem_packet_scope(), tvb, offset, value_len));
} else if (HDR_MATCHES(rtsp_content_length))
{
@@ -1101,7 +1101,7 @@ dissect_rtspmessage(tvbuff_t *tvb, int offset, packet_info *pinfo,
e164_info.e164_number_type = CALLING_PARTY_NUMBER;
e164_info.nature_of_address = 0;
- e164_info.E164_number_str = tvb_get_ephemeral_string(tvb, value_offset,
+ e164_info.E164_number_str = tvb_get_string(wmem_packet_scope(), tvb, value_offset,
value_len);
e164_info.E164_number_length = value_len;
dissect_e164_number(tvb, sub_tree, value_offset,
diff --git a/epan/dissectors/packet-sabp.c b/epan/dissectors/packet-sabp.c
index d47a22ad7a..9e43d0101f 100644
--- a/epan/dissectors/packet-sabp.c
+++ b/epan/dissectors/packet-sabp.c
@@ -1795,7 +1795,7 @@ dissect_sabp_cb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (unpacked_tvb != NULL){
if (tree != NULL){
proto_tree *cbs_page_subtree = proto_item_add_subtree(cbs_page_item, ett_sabp_cbs_page_content);
- proto_tree_add_string(cbs_page_subtree, hf_sabp_cbs_page_content, unpacked_tvb, 0, len, tvb_get_ephemeral_string(unpacked_tvb, 0, len));
+ proto_tree_add_string(cbs_page_subtree, hf_sabp_cbs_page_content, unpacked_tvb, 0, len, tvb_get_string(wmem_packet_scope(), unpacked_tvb, 0, len));
}
}
diff --git a/epan/dissectors/packet-sametime.c b/epan/dissectors/packet-sametime.c
index 1bc9eee101..06a219f9d4 100644
--- a/epan/dissectors/packet-sametime.c
+++ b/epan/dissectors/packet-sametime.c
@@ -235,7 +235,7 @@ add_text_item(tvbuff_t *tvb, proto_tree *tree, int offset, int hf)
proto_tree_add_item(tree, hf_sametime_field_length, tvb, offset, 2, ENC_BIG_ENDIAN);
/* add string */
- proto_tree_add_string(tree, hf, tvb, offset + 2, length, tvb_get_ephemeral_string(tvb, offset + 2, length));
+ proto_tree_add_string(tree, hf, tvb, offset + 2, length, tvb_get_string(wmem_packet_scope(), tvb, offset + 2, length));
}
return 2 + length;
diff --git a/epan/dissectors/packet-sap.c b/epan/dissectors/packet-sap.c
index 87b4612851..6d388f4fb4 100644
--- a/epan/dissectors/packet-sap.c
+++ b/epan/dissectors/packet-sap.c
@@ -262,7 +262,7 @@ dissect_sap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pt_len = pt_string_len + 1;
}
- pt_str = tvb_get_ephemeral_string(tvb, offset, pt_string_len);
+ pt_str = tvb_get_string(wmem_packet_scope(), tvb, offset, pt_string_len);
proto_tree_add_string_format_value(sap_tree, hf_sap_payload_type, tvb, offset, pt_len,
pt_str, "%.*s", pt_string_len, pt_str);
offset += pt_len;
diff --git a/epan/dissectors/packet-sbus.c b/epan/dissectors/packet-sbus.c
index e0179fd275..a408d61e6f 100644
--- a/epan/dissectors/packet-sbus.c
+++ b/epan/dissectors/packet-sbus.c
@@ -783,7 +783,7 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
sbus_quint8_helper0 += 1;
}
- tmp_string = tvb_get_ephemeral_string(tvb , 19,
+ tmp_string = tvb_get_string(wmem_packet_scope(), tvb , 19,
sbus_quint8_helper0);
col_append_fstr(pinfo->cinfo, COL_INFO,
": (File: %s)", tmp_string);
@@ -800,7 +800,7 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
sbus_quint8_helper0 += 1;
}
- tmp_string = tvb_get_ephemeral_string(tvb , 15,
+ tmp_string = tvb_get_string(wmem_packet_scope(), tvb , 15,
sbus_quint8_helper0);
col_append_fstr(pinfo->cinfo, COL_INFO,
": (File: %s)", tmp_string);
@@ -1245,7 +1245,7 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
sbus_quint8_helper0 += 1;
}
- tmp_string = tvb_get_ephemeral_string(tvb , 19, sbus_quint8_helper0);
+ tmp_string = tvb_get_string(wmem_packet_scope(), tvb , 19, sbus_quint8_helper0);
proto_tree_add_string(sbus_tree,
hf_sbus_rdwr_file_name, tvb, offset,
sbus_quint8_helper0, tmp_string);
@@ -1310,7 +1310,7 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
sbus_quint8_helper0 += 1;
}
- tmp_string = tvb_get_ephemeral_string(tvb, 19, sbus_quint8_helper0);
+ tmp_string = tvb_get_string(wmem_packet_scope(), tvb, 19, sbus_quint8_helper0);
proto_tree_add_string(sbus_tree,
hf_sbus_rdwr_file_name, tvb, offset,
sbus_quint8_helper0, tmp_string);
@@ -1352,7 +1352,7 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
sbus_quint8_helper0 += 1;
}
- tmp_string = tvb_get_ephemeral_string(tvb, 14, sbus_quint8_helper0);
+ tmp_string = tvb_get_string(wmem_packet_scope(), tvb, 14, sbus_quint8_helper0);
proto_tree_add_string(sbus_tree,
hf_sbus_rdwr_file_name, tvb, offset,
sbus_quint8_helper0, tmp_string);
@@ -1396,7 +1396,7 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
sbus_quint8_helper0 += 1;
}
- tmp_string = tvb_get_ephemeral_string(tvb, 22, sbus_quint8_helper0);
+ tmp_string = tvb_get_string(wmem_packet_scope(), tvb, 22, sbus_quint8_helper0);
proto_tree_add_string(sbus_tree,
hf_sbus_rdwr_file_name, tvb, offset,
sbus_quint8_helper0, tmp_string);
@@ -1435,7 +1435,7 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
sbus_quint8_helper0 += 1;
}
- tmp_string = tvb_get_ephemeral_string(tvb, 14, sbus_quint8_helper0);
+ tmp_string = tvb_get_string(wmem_packet_scope(), tvb, 14, sbus_quint8_helper0);
proto_tree_add_string(sbus_tree,
hf_sbus_rdwr_file_name, tvb, offset,
sbus_quint8_helper0, tmp_string);
@@ -1594,12 +1594,12 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
/* Response: Firmware version */
case SBUS_RD_PROGRAM_VERSION:
/*PCD type*/
- tmp_string = tvb_get_ephemeral_string(tvb , offset, 5);
+ tmp_string = tvb_get_string(wmem_packet_scope(), tvb , offset, 5);
proto_tree_add_string(sbus_tree,
hf_sbus_cpu_type, tvb, offset, 5, tmp_string);
offset += 5;
/*FW version*/
- tmp_string = tvb_get_ephemeral_string(tvb , offset, 3);
+ tmp_string = tvb_get_string(wmem_packet_scope(), tvb , offset, 3);
proto_tree_add_string(sbus_tree,
hf_sbus_fw_version, tvb, offset, 3, tmp_string);
offset += 4;
diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c
index 7d0fe69d81..b07574596d 100644
--- a/epan/dissectors/packet-sctp.c
+++ b/epan/dissectors/packet-sctp.c
@@ -1028,7 +1028,7 @@ dissect_hostname_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree,
hostname_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
proto_tree_add_item(parameter_tree, hf_hostname, parameter_tvb, HOSTNAME_OFFSET, hostname_length, ENC_ASCII|ENC_NA);
- proto_item_append_text(parameter_item, " (Hostname: %.*s)", hostname_length, tvb_get_ephemeral_string(parameter_tvb, HOSTNAME_OFFSET, hostname_length));
+ proto_item_append_text(parameter_item, " (Hostname: %.*s)", hostname_length, tvb_get_string(wmem_packet_scope(), parameter_tvb, HOSTNAME_OFFSET, hostname_length));
}
diff --git a/epan/dissectors/packet-sdp.c b/epan/dissectors/packet-sdp.c
index aa870bcb88..e5e674a806 100644
--- a/epan/dissectors/packet-sdp.c
+++ b/epan/dissectors/packet-sdp.c
@@ -367,7 +367,7 @@ dissect_sdp_connection_info(tvbuff_t *tvb, proto_item* ti,
return;
tokenlen = next_offset - offset;
/* Save connection address type */
- media_info->connection_type = (char*)tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ media_info->connection_type = (char*)tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
proto_tree_add_item(sdp_connection_info_tree,
@@ -382,11 +382,11 @@ dissect_sdp_connection_info(tvbuff_t *tvb, proto_item* ti,
tokenlen = -1; /* end of tvbuff */
/* Save connection address */
media_info->connection_address =
- (char*)tvb_get_ephemeral_string(tvb, offset, tvb_length_remaining(tvb, offset));
+ (char*)tvb_get_string(wmem_packet_scope(), tvb, offset, tvb_length_remaining(tvb, offset));
} else {
tokenlen = next_offset - offset;
/* Save connection address */
- media_info->connection_address = (char*)tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ media_info->connection_address = (char*)tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
}
proto_tree_add_item(sdp_connection_info_tree,
@@ -591,7 +591,7 @@ static void dissect_key_mgmt(tvbuff_t *tvb, packet_info * pinfo, proto_item * ti
return;
tokenlen = next_offset - offset;
- prtcl_id = tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ prtcl_id = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
proto_tree_add_item(key_tree, hf_key_mgmt_prtcl_id, tvb, offset, tokenlen, ENC_ASCII|ENC_NA);
@@ -601,7 +601,7 @@ static void dissect_key_mgmt(tvbuff_t *tvb, packet_info * pinfo, proto_item * ti
if (len < 0)
return;
- data_p = tvb_get_ephemeral_string(tvb, offset, len);
+ data_p = tvb_get_string(wmem_packet_scope(), tvb, offset, len);
keymgmt_tvb = base64_to_tvb(tvb, data_p);
add_new_data_source(pinfo, keymgmt_tvb, "Key Management Data");
@@ -644,7 +644,7 @@ static void dissect_sdp_session_attribute(tvbuff_t *tvb, packet_info * pinfo, pr
proto_tree_add_item(sdp_session_attribute_tree, hf_session_attribute_field,
tvb, offset, tokenlen, ENC_ASCII|ENC_NA);
- field_name = tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ field_name = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
offset = next_offset + 1;
@@ -713,7 +713,7 @@ dissect_sdp_media(tvbuff_t *tvb, proto_item *ti,
proto_tree_add_item(sdp_media_tree, hf_media_media, tvb, offset, tokenlen,
ENC_ASCII|ENC_NA);
- media_info->media_type = (char*)tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ media_info->media_type = (char*)tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
offset = next_offset + 1;
@@ -726,10 +726,10 @@ dissect_sdp_media(tvbuff_t *tvb, proto_item *ti,
if (next_offset != -1) {
tokenlen = next_offset - offset;
/* Save port info */
- media_info->media_port[media_info->media_count] = (char*)tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ media_info->media_port[media_info->media_count] = (char*)tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
proto_tree_add_uint(sdp_media_tree, hf_media_port, tvb, offset, tokenlen,
- atoi((char*)tvb_get_ephemeral_string(tvb, offset, tokenlen)));
+ atoi((char*)tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen)));
offset = next_offset + 1;
next_offset = tvb_find_guint8(tvb, offset, -1, ' ');
if (next_offset == -1)
@@ -745,10 +745,10 @@ dissect_sdp_media(tvbuff_t *tvb, proto_item *ti,
return;
tokenlen = next_offset - offset;
/* Save port info */
- media_info->media_port[media_info->media_count] = (char*)tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ media_info->media_port[media_info->media_count] = (char*)tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
/* XXX Remember Port */
proto_tree_add_uint(sdp_media_tree, hf_media_port, tvb, offset, tokenlen,
- atoi((char*)tvb_get_ephemeral_string(tvb, offset, tokenlen)));
+ atoi((char*)tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen)));
offset = next_offset + 1;
}
@@ -759,7 +759,7 @@ dissect_sdp_media(tvbuff_t *tvb, proto_item *ti,
tokenlen = next_offset - offset;
/* Save port protocol */
- media_info->media_proto[media_info->media_count] = (char*)tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ media_info->media_proto[media_info->media_count] = (char*)tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
/* XXX Remember Protocol */
proto_tree_add_item(sdp_media_tree, hf_media_proto, tvb, offset, tokenlen,
@@ -778,7 +778,7 @@ dissect_sdp_media(tvbuff_t *tvb, proto_item *ti,
}
if (!strcmp(media_info->media_proto[media_info->media_count], "RTP/AVP")) {
- media_format = tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ media_format = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
proto_tree_add_string(sdp_media_tree, hf_media_format, tvb, offset,
tokenlen, val_to_str_ext((guint32)strtoul((char*)media_format, NULL, 10), &rtp_payload_type_vals_ext, "%u"));
idx = transport_info->media[transport_info->media_count].pt_count;
@@ -929,7 +929,7 @@ decode_sdp_fmtp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint offset
#if 0
proto_tree_add_text(tree, tvb, offset, tokenlen, "Debug; Analysed string: '%s'",
- tvb_get_ephemeral_string(tvb, offset, tokenlen));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen));
#endif
/* Look for an '=' within this value - this may indicate that there is a
@@ -943,7 +943,7 @@ decode_sdp_fmtp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint offset
/* Find the name of the parameter */
tokenlen = next_offset - offset;
- field_name = tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ field_name = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
#if 0
proto_tree_add_text(tree, tvb, offset, tokenlen, "Debug; MIMEtype '%s'Parameter name: '%s'", mime_type, field_name); */
#endif
@@ -954,14 +954,14 @@ decode_sdp_fmtp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint offset
if (strcmp((char*)field_name, "profile-level-id") == 0) {
offset++;
tokenlen = end_offset - offset;
- format_specific_parameter = tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ format_specific_parameter = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
item = proto_tree_add_uint(tree, hf_sdp_fmtp_mpeg4_profile_level_id, tvb, offset, tokenlen,
(guint32)strtol((char*)format_specific_parameter, NULL, 10));
PROTO_ITEM_SET_GENERATED(item);
} else if (strcmp((char*)field_name, "config") == 0) {
/* String including "=" */
tokenlen = end_offset - offset;
- format_specific_parameter = tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ format_specific_parameter = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
/* ascii_bytes_to_tvb requires the "=" to be in the buffer */
data_tvb = ascii_bytes_to_tvb(tvb, pinfo, tokenlen, format_specific_parameter);
if (mp4ves_handle && data_tvb) {
@@ -976,14 +976,14 @@ decode_sdp_fmtp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint offset
if (strcmp((char*)field_name, "profile") == 0) {
offset++;
tokenlen = end_offset - offset;
- format_specific_parameter = tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ format_specific_parameter = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
item = proto_tree_add_uint(tree, hf_sdp_fmtp_h263_profile, tvb, offset, tokenlen,
(guint32)strtol((char*)format_specific_parameter, NULL, 10));
PROTO_ITEM_SET_GENERATED(item);
} else if (strcmp((char*)field_name, "level") == 0) {
offset++;
tokenlen = end_offset - offset;
- format_specific_parameter = tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ format_specific_parameter = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
item = proto_tree_add_uint(tree, hf_sdp_fmtp_h263_level, tvb, offset, tokenlen,
(guint32)strtol((char*)format_specific_parameter, NULL, 10));
PROTO_ITEM_SET_GENERATED(item);
@@ -1009,7 +1009,7 @@ decode_sdp_fmtp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint offset
/* Length includes "=" as it's required by ascii_bytes_to_tvb()*/
tokenlen = end_offset - offset;
- format_specific_parameter = tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ format_specific_parameter = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
data_tvb = ascii_bytes_to_tvb(tvb, pinfo, tokenlen, format_specific_parameter);
if (!data_tvb) {
proto_tree_add_text(tree, tvb, offset, tokenlen, "Could not convert '%s' to 3 bytes", format_specific_parameter);
@@ -1027,7 +1027,7 @@ decode_sdp_fmtp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint offset
} else if (strcmp(field_name, "packetization-mode") == 0) {
offset++;
tokenlen = end_offset - offset;
- format_specific_parameter = tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ format_specific_parameter = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
item = proto_tree_add_uint(tree, hf_sdp_h264_packetization_mode, tvb, offset, tokenlen,
(guint32)strtol((char*)format_specific_parameter, NULL, 10));
PROTO_ITEM_SET_GENERATED(item);
@@ -1054,7 +1054,7 @@ decode_sdp_fmtp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint offset
tokenlen = end_offset - offset;
}
- data_p = tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ data_p = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
proto_tree_add_text(tree, tvb, offset, tokenlen, "NAL unit 1 string: %s", data_p);
/* proto_tree_add_text(tree, tvb, offset, tokenlen, "String %s", data_p); */
@@ -1073,7 +1073,7 @@ decode_sdp_fmtp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint offset
/* Second NAL unit */
offset = comma_offset +1;
tokenlen = end_offset - offset;
- data_p = tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ data_p = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
proto_tree_add_text(tree, tvb, offset, tokenlen, "NAL unit 2 string: %s", data_p);
data_tvb = base64_to_tvb(tvb, data_p);
add_new_data_source(pinfo, data_tvb, "h264 prop-parameter-sets 2");
@@ -1154,7 +1154,7 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
proto_tree_add_item(sdp_media_attribute_tree,
hf_media_attribute_field,
tvb, offset, tokenlen, ENC_ASCII|ENC_NA);
- /*??field_name = tvb_get_ephemeral_string(tvb, offset, tokenlen);*/
+ /*??field_name = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);*/
sdp_media_attrbute_code = find_sdp_media_attribute_names(tvb, offset, tokenlen);
/* Skip colon */
@@ -1163,7 +1163,7 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
offset = tvb_skip_wsp(tvb, offset, tvb_length_remaining(tvb, offset));
/* Value is the remainder of the line */
- attribute_value = tvb_get_ephemeral_string(tvb, offset, tvb_length_remaining(tvb, offset));
+ attribute_value = tvb_get_string(wmem_packet_scope(), tvb, offset, tvb_length_remaining(tvb, offset));
@@ -1183,7 +1183,7 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
proto_tree_add_item(sdp_media_attribute_tree, hf_media_format, tvb,
offset, tokenlen, ENC_ASCII|ENC_NA);
- payload_type = tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ payload_type = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
offset = next_offset + 1;
@@ -1206,7 +1206,7 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
key = wmem_new(wmem_file_scope(), gint);
*key = (gint)strtol((char*)payload_type, NULL, 10);
- transport_info->encoding_name[pt] = (char*)tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ transport_info->encoding_name[pt] = (char*)tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
next_offset = next_offset + 1;
offset = next_offset;
@@ -1218,7 +1218,7 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
tokenlen = next_offset - offset;
proto_tree_add_item(sdp_media_attribute_tree, hf_media_sample_rate, tvb,
offset, tokenlen, ENC_ASCII|ENC_NA);
- transport_info->sample_rate[pt] = atoi(tvb_get_ephemeral_string(tvb, offset, tokenlen));
+ transport_info->sample_rate[pt] = atoi(tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen));
/* As per RFC2327 it is possible to have multiple Media Descriptions ("m=").
For example:
@@ -1281,7 +1281,7 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
media_format_item = proto_tree_add_item(sdp_media_attribute_tree,
hf_media_format, tvb, offset,
tokenlen, ENC_ASCII|ENC_NA);
- media_format = atoi((char*)tvb_get_ephemeral_string(tvb, offset, tokenlen));
+ media_format = atoi((char*)tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen));
if (media_format >= SDP_NO_OF_PT) {
return; /* Invalid */
}
@@ -1291,7 +1291,7 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
transport_info->encoding_name[media_format]);
#if 0 /* XXX: ?? */
- payload_type = tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ payload_type = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
#endif
/* Move offset past the payload type */
offset = next_offset + 1;
@@ -1357,10 +1357,10 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
}
/* Attempt to convert address */
if (inet_pton(AF_INET,
- (char*)tvb_get_ephemeral_string(tvb, address_offset, port_offset-address_offset),
+ (char*)tvb_get_string(wmem_packet_scope(), tvb, address_offset, port_offset-address_offset),
&media_info->msrp_ipaddr) > 0) {
/* Get port number */
- media_info->msrp_port_number = atoi((char*)tvb_get_ephemeral_string(tvb, port_offset + 1, port_end_offset - port_offset - 1));
+ media_info->msrp_port_number = atoi((char*)tvb_get_string(wmem_packet_scope(), tvb, port_offset + 1, port_end_offset - port_offset - 1));
/* Set flag so this info can be used */
media_info->msrp_transport_address_set = TRUE;
}
@@ -1426,7 +1426,7 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
}
tokenlen = next_offset - offset;
proto_tree_add_uint(sdp_media_attribute_tree, hf_sdp_crypto_tag, tvb, offset, tokenlen,
- atoi((char*)tvb_get_ephemeral_string(tvb, offset, tokenlen)));
+ atoi((char*)tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen)));
offset = next_offset + 1;
/* crypto-suite */
@@ -1503,7 +1503,7 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
} else {
tokenlen = next_offset - offset;
}
- data_p = tvb_get_ephemeral_string(tvb, offset, tokenlen);
+ data_p = tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen);
key_salt_tvb = base64_to_tvb(tvb, data_p);
add_new_data_source(pinfo, key_salt_tvb, "Key_Salt_tvb");
if (master_key_length != 0) {
@@ -1552,7 +1552,7 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
/* This will not work if more than one parameter */
/* number of octets used for the MKI in the RTP payload */
- transport_info->mki_len = atoi((char*)tvb_get_ephemeral_string(tvb, offset, tokenlen));
+ transport_info->mki_len = atoi((char*)tvb_get_string(wmem_packet_scope(), tvb, offset, tokenlen));
proto_tree_add_item(parameter_tree, hf_sdp_crypto_mki_length,
tvb, offset, tokenlen, ENC_ASCII|ENC_NA);
}
@@ -2137,7 +2137,7 @@ dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tokenoffset = 2;
if (hf == hf_unknown)
tokenoffset = 0;
- string = (char*)tvb_get_ephemeral_string(tvb, offset + tokenoffset,
+ string = (char*)tvb_get_string(wmem_packet_scope(), tvb, offset + tokenoffset,
linelen - tokenoffset);
sub_ti = proto_tree_add_string(sdp_tree, hf, tvb, offset, linelen,
string);
diff --git a/epan/dissectors/packet-selfm.c b/epan/dissectors/packet-selfm.c
index b42915d375..227d108780 100644
--- a/epan/dissectors/packet-selfm.c
+++ b/epan/dissectors/packet-selfm.c
@@ -1666,7 +1666,7 @@ dissect_fastser_readresp_frame(tvbuff_t *tvb, proto_tree *fastser_tree, packet_i
case FAST_SER_TAGTYPE_CHAR8:
case FAST_SER_TAGTYPE_CHAR16:
- item_val_str_ptr = tvb_get_ephemeral_string(payload_tvb, payload_offset, data_size);
+ item_val_str_ptr = tvb_get_string(wmem_packet_scope(), payload_tvb, payload_offset, data_size);
proto_tree_add_text(fastser_tag_tree, payload_tvb, payload_offset, data_size, "Value: %s", item_val_str_ptr);
payload_offset += data_size;
break;
@@ -2067,8 +2067,8 @@ dissect_fastser_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int o
case FAST_SER_DEVDESC_RESP: /* 0xB0 (resp to 0x30) - Device Description Response */
- fid_str_ptr = tvb_get_ephemeral_string(tvb, offset, 50); /* Add FID / RID ASCII data to tree */
- rid_str_ptr = tvb_get_ephemeral_string(tvb, offset+50, 40);
+ fid_str_ptr = tvb_get_string(wmem_packet_scope(), tvb, offset, 50); /* Add FID / RID ASCII data to tree */
+ rid_str_ptr = tvb_get_string(wmem_packet_scope(), tvb, offset+50, 40);
proto_tree_add_text(fastser_tree, tvb, offset, 50, "FID: %s", fid_str_ptr);
proto_tree_add_text(fastser_tree, tvb, offset+50, 40, "RID: %s", rid_str_ptr);
offset += 90;
@@ -2099,7 +2099,7 @@ dissect_fastser_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int o
fastser_datareg_tree = proto_item_add_subtree(fastser_datareg_item, ett_selfm_fastser_datareg);
/* 10-Byte Region description */
- region_name_ptr = tvb_get_ephemeral_string(tvb, offset, 10);
+ region_name_ptr = tvb_get_string(wmem_packet_scope(), tvb, offset, 10);
proto_tree_add_text(fastser_datareg_tree, tvb, offset, 10, "Data Region Name: %s", region_name_ptr);
offset += 10;
@@ -2146,7 +2146,7 @@ dissect_fastser_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int o
offset += 2;
while ((tvb_reported_length_remaining(tvb, offset)) > 2) {
- tag_name_ptr = tvb_get_ephemeral_string(tvb, offset, 10); /* Data Item record name 10 bytes */
+ tag_name_ptr = tvb_get_string(wmem_packet_scope(), tvb, offset, 10); /* Data Item record name 10 bytes */
fastser_tag_item = proto_tree_add_text(fastser_tree, tvb, offset, 14, "Data Item Record Name: %s", tag_name_ptr);
fastser_tag_tree = proto_item_add_subtree(fastser_tag_item, ett_selfm_fastser_tag);
diff --git a/epan/dissectors/packet-sgsap.c b/epan/dissectors/packet-sgsap.c
index b53b6c9e28..72e4b6f6e5 100644
--- a/epan/dissectors/packet-sgsap.c
+++ b/epan/dissectors/packet-sgsap.c
@@ -332,7 +332,7 @@ de_sgsap_mme_name(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint
name_len = tvb_get_guint8(tvb, offset);
if (name_len < 0x20) {
- fqdn = tvb_get_ephemeral_string(tvb, offset + 1, len - 1);
+ fqdn = tvb_get_string(wmem_packet_scope(), tvb, offset + 1, len - 1);
for (;;) {
if (name_len >= len - 1)
break;
@@ -341,7 +341,7 @@ de_sgsap_mme_name(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint
fqdn[tmp] = '.';
}
} else{
- fqdn = tvb_get_ephemeral_string(tvb, offset, len);
+ fqdn = tvb_get_string(wmem_packet_scope(), tvb, offset, len);
}
proto_tree_add_string(tree, hf_sgsap_mme_name, tvb, offset, len, fqdn);
if (add_string)
@@ -532,7 +532,7 @@ de_sgsap_vlr_name(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint
name_len = tvb_get_guint8(tvb, offset);
if (name_len < 0x20) {
- fqdn = tvb_get_ephemeral_string(tvb, offset + 1, len - 1);
+ fqdn = tvb_get_string(wmem_packet_scope(), tvb, offset + 1, len - 1);
for (;;) {
if (name_len >= len - 1)
break;
@@ -541,7 +541,7 @@ de_sgsap_vlr_name(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint
fqdn[tmp] = '.';
}
} else{
- fqdn = tvb_get_ephemeral_string(tvb, offset, len);
+ fqdn = tvb_get_string(wmem_packet_scope(), tvb, offset, len);
}
proto_tree_add_string(tree, hf_sgsap_vlr_name, tvb, offset, len, fqdn);
if (add_string)
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c
index 1d7f5783e8..d818e29529 100644
--- a/epan/dissectors/packet-sip.c
+++ b/epan/dissectors/packet-sip.c
@@ -1631,7 +1631,7 @@ dissect_sip_authorization_item(tvbuff_t *tvb, proto_tree *tree, gint start_offse
par_name_end_offset = tvb_skip_wsp_return(tvb,par_name_end_offset);
/* Extract the parameter name */
- name = tvb_get_ephemeral_string(tvb, start_offset, par_name_end_offset-start_offset);
+ name = tvb_get_string(wmem_packet_scope(), tvb, start_offset, par_name_end_offset-start_offset);
/* Find end of parameter, it can be a quoted string so check for quoutes too */
queried_offset = par_name_end_offset;
@@ -1720,13 +1720,13 @@ dissect_sip_reason_header(tvbuff_t *tvb, proto_tree *tree, gint start_offset, gi
proto_tree_add_text(tree, tvb, start_offset, length,
"Reason Protocols: %s", tvb_format_text(tvb, start_offset, length));
- param_name = tvb_get_ephemeral_string(tvb, start_offset, length);
+ param_name = tvb_get_string(wmem_packet_scope(), tvb, start_offset, length);
if (g_ascii_strcasecmp(param_name, "Q.850") == 0){
current_offset = tvb_find_guint8(tvb, semi_colon_offset, line_end_offset-semi_colon_offset, '=')+1;
length = line_end_offset - current_offset;
/* q850_cause_code_vals */
- cause_value = (guint)strtoul(tvb_get_ephemeral_string(tvb, current_offset, length), NULL, 10);
+ cause_value = (guint)strtoul(tvb_get_string(wmem_packet_scope(), tvb, current_offset, length), NULL, 10);
proto_tree_add_text(tree, tvb, current_offset, length,
"Cause: %u(0x%x)[%s]", cause_value,cause_value,
val_to_str_ext(cause_value, &q850_cause_code_vals_ext, "Unknown (%d)" ));
@@ -1905,7 +1905,7 @@ static void dissect_sip_via_header(tvbuff_t *tvb, proto_tree *tree, gint start_o
/* Add address port number to tree */
proto_tree_add_uint(tree, hf_sip_via_sent_by_port, tvb, port_offset,
current_offset - port_offset,
- atoi(tvb_get_ephemeral_string(tvb, port_offset,
+ atoi(tvb_get_string(wmem_packet_scope(), tvb, port_offset,
current_offset - port_offset)));
}
else
@@ -1992,7 +1992,7 @@ static void dissect_sip_via_header(tvbuff_t *tvb, proto_tree *tree, gint start_o
}
/* Note parameter name */
- param_name = tvb_get_ephemeral_string(tvb, semicolon_offset+1,
+ param_name = tvb_get_string(wmem_packet_scope(), tvb, semicolon_offset+1,
parameter_name_end - semicolon_offset - 1);
/* Try to add parameter as a filterable item */
@@ -2237,7 +2237,7 @@ dissect_sip_common(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tr
descr = "Status";
col_add_fstr(pinfo->cinfo, COL_INFO, "Status: %s",
tvb_format_text(tvb, offset + SIP2_HDR_LEN + 1, linelen - SIP2_HDR_LEN - 1));
- stat_info->reason_phrase = tvb_get_ephemeral_string(tvb, offset + SIP2_HDR_LEN + 5, linelen - (SIP2_HDR_LEN + 5));
+ stat_info->reason_phrase = tvb_get_string(wmem_packet_scope(), tvb, offset + SIP2_HDR_LEN + 5, linelen - (SIP2_HDR_LEN + 5));
break;
case OTHER_LINE:
@@ -2364,7 +2364,7 @@ dissect_sip_common(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tr
}
} else {
header_len = colon_offset - offset;
- header_name = (gchar*)tvb_get_ephemeral_string(tvb, offset, header_len);
+ header_name = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, offset, header_len);
ascii_strdown_inplace(header_name);
hf_index = sip_is_known_sip_header(header_name, header_len);
@@ -2377,7 +2377,7 @@ dissect_sip_common(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tr
* Fetch the value.
*/
value_len = (gint) (line_end_offset - value_offset);
- value = tvb_get_ephemeral_string(tvb, value_offset, value_len);
+ value = tvb_get_string(wmem_packet_scope(), tvb, value_offset, value_len);
if (hf_index == -1) {
proto_item *ti_c = proto_tree_add_text(hdr_tree, tvb,
@@ -2419,7 +2419,7 @@ dissect_sip_common(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tr
if((dissect_sip_name_addr_or_addr_spec(tvb, pinfo, value_offset, line_end_offset+2, &uri_offsets)) != -1){
display_sip_uri(tvb, sip_element_tree, &uri_offsets, &sip_to_uri);
if((uri_offsets.name_addr_start != -1) && (uri_offsets.name_addr_end != -1)){
- stat_info->tap_to_addr=tvb_get_ephemeral_string(tvb, uri_offsets.name_addr_start,
+ stat_info->tap_to_addr=tvb_get_string(wmem_packet_scope(), tvb, uri_offsets.name_addr_start,
uri_offsets.name_addr_end - uri_offsets.name_addr_start);
}
offset = uri_offsets.name_addr_end +1;
@@ -2481,7 +2481,7 @@ dissect_sip_common(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tr
if((dissect_sip_name_addr_or_addr_spec(tvb, pinfo, value_offset, line_end_offset+2, &uri_offsets)) != -1){
display_sip_uri(tvb, sip_element_tree, &uri_offsets, &sip_from_uri);
if((uri_offsets.name_addr_start != -1) && (uri_offsets.name_addr_end != -1)){
- stat_info->tap_from_addr=tvb_get_ephemeral_string(tvb, uri_offsets.name_addr_start,
+ stat_info->tap_from_addr=tvb_get_string(wmem_packet_scope(), tvb, uri_offsets.name_addr_start,
uri_offsets.name_addr_end - uri_offsets.name_addr_start);
}
offset = uri_offsets.name_addr_end +1;
@@ -2871,11 +2871,11 @@ dissect_sip_common(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tr
content_type_end = tvb_skip_wsp_return(tvb, semi_colon_offset-1);
content_type_len = content_type_end - value_offset;
content_type_parameter_str_len = value_offset + value_len - parameter_offset;
- content_type_parameter_str = tvb_get_ephemeral_string(tvb, parameter_offset,
+ content_type_parameter_str = tvb_get_string(wmem_packet_scope(), tvb, parameter_offset,
content_type_parameter_str_len);
}
media_type_str_lower_case = ascii_strdown_inplace(
- (gchar *)tvb_get_ephemeral_string(tvb, value_offset, content_type_len));
+ (gchar *)tvb_get_string(wmem_packet_scope(), tvb, value_offset, content_type_len));
/* Debug code
proto_tree_add_text(hdr_tree, tvb, value_offset,content_type_len,
@@ -3085,7 +3085,7 @@ dissect_sip_common(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tr
value, "%s",
tvb_format_text(tvb, offset, linelen));
}
- content_encoding_parameter_str = ascii_strdown_inplace(tvb_get_ephemeral_string(tvb, value_offset,
+ content_encoding_parameter_str = ascii_strdown_inplace(tvb_get_string(wmem_packet_scope(), tvb, value_offset,
(line_end_offset-value_offset)));
break;
default :
@@ -3329,7 +3329,7 @@ dfilter_sip_request_line(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gi
*/
/* get method string*/
- value = tvb_get_ephemeral_string(tvb, offset, parameter_len);
+ value = tvb_get_string(wmem_packet_scope(), tvb, offset, parameter_len);
/* Copy request method for telling tap */
stat_info->request_method = value;
@@ -3361,7 +3361,7 @@ dfilter_sip_status_line(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gin
* We also know that we have a version string followed by a
* space at the beginning of the line, for the same reason.
*/
- response_code = atoi((char*)tvb_get_ephemeral_string(tvb, offset + SIP2_HDR_LEN + 1, 3));
+ response_code = atoi((char*)tvb_get_string(wmem_packet_scope(), tvb, offset + SIP2_HDR_LEN + 1, 3));
/* Add numerical response code to tree */
if (tree) {
@@ -3522,7 +3522,7 @@ static gboolean sip_is_known_request(tvbuff_t *tvb, int meth_offset,
guint i;
gchar *meth_name;
- meth_name = tvb_get_ephemeral_string(tvb, meth_offset, meth_len);
+ meth_name = tvb_get_string(wmem_packet_scope(), tvb, meth_offset, meth_len);
for (i = 1; i < array_length(sip_methods); i++) {
if (meth_len == strlen(sip_methods[i]) &&
diff --git a/epan/dissectors/packet-sipfrag.c b/epan/dissectors/packet-sipfrag.c
index f18b49a4db..1692447069 100644
--- a/epan/dissectors/packet-sipfrag.c
+++ b/epan/dissectors/packet-sipfrag.c
@@ -74,7 +74,7 @@ static void dissect_sipfrag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* For now, add all lines as unparsed strings */
/* Extract & add the string. */
- string = (char*)tvb_get_ephemeral_string(tvb, offset, linelen);
+ string = (char*)tvb_get_string(wmem_packet_scope(), tvb, offset, linelen);
proto_tree_add_string_format(sipfrag_tree, hf_sipfrag_line,
tvb, offset,
linelen, string,
diff --git a/epan/dissectors/packet-slsk.c b/epan/dissectors/packet-slsk.c
index 4bb7ba49fa..86510b60f6 100644
--- a/epan/dissectors/packet-slsk.c
+++ b/epan/dissectors/packet-slsk.c
@@ -969,7 +969,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
offset += 4+len;
len = tvb_get_letohl(tvb, offset);
proto_tree_add_uint(slsk_tree, hf_slsk_string_length, tvb, offset, 4, len);
- str = tvb_get_ephemeral_string(tvb, offset+4, len);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset+4, len);
proto_tree_add_string_format(slsk_tree, hf_slsk_connection_type, tvb, offset+4, len, str,
"Connection Type: %s (Char: %s)", connection_type(str),
format_text(str, len));
@@ -989,7 +989,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
offset += 4+len;
len = tvb_get_letohl(tvb, offset);
proto_tree_add_uint(slsk_tree, hf_slsk_string_length, tvb, offset, 4, len);
- str = tvb_get_ephemeral_string(tvb, offset+4, len);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset+4, len);
proto_tree_add_string_format(slsk_tree, hf_slsk_connection_type, tvb, offset+4, len, str,
"Connection Type: %s (Char: %s)", connection_type(str),
format_text(str, len));
@@ -2346,7 +2346,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
offset += 4+len;
len = tvb_get_letohl(tvb, offset);
proto_tree_add_uint(slsk_tree, hf_slsk_string_length, tvb, offset, 4, len);
- str = tvb_get_ephemeral_string(tvb, offset+4, len);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset+4, len);
proto_tree_add_string_format(slsk_tree, hf_slsk_connection_type, tvb, offset+4, len, str,
"Connection Type: %s (Char: %s)", connection_type(str),
format_text(str, len));
diff --git a/epan/dissectors/packet-smb-pipe.c b/epan/dissectors/packet-smb-pipe.c
index 94bbba6699..063b9a0f0d 100644
--- a/epan/dissectors/packet-smb-pipe.c
+++ b/epan/dissectors/packet-smb-pipe.c
@@ -785,7 +785,7 @@ netshareenum_share_entry(tvbuff_t *tvb, proto_tree *tree, int offset)
{
if (tree) {
return proto_tree_add_text(tree, tvb, offset, -1,
- "Share %.13s", tvb_get_ephemeral_string(tvb, offset, 13));
+ "Share %.13s", tvb_get_string(wmem_packet_scope(), tvb, offset, 13));
} else
return NULL;
}
@@ -985,7 +985,7 @@ netserverenum2_server_entry(tvbuff_t *tvb, proto_tree *tree, int offset)
{
if (tree) {
return proto_tree_add_text(tree, tvb, offset, -1,
- "Server %.16s", tvb_get_ephemeral_string(tvb, offset, 16));
+ "Server %.16s", tvb_get_string(wmem_packet_scope(), tvb, offset, 16));
} else
return NULL;
}
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c
index 69ac069d62..2426e6aa9e 100644
--- a/epan/dissectors/packet-smb.c
+++ b/epan/dissectors/packet-smb.c
@@ -7798,7 +7798,7 @@ dissect_tree_connect_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* XXX - what if this runs past bc? */
an_len = tvb_strsize(tvb, offset);
CHECK_BYTE_COUNT(an_len);
- an = tvb_get_ephemeral_string(tvb, offset, an_len);
+ an = tvb_get_string(wmem_packet_scope(), tvb, offset, an_len);
proto_tree_add_string(tree, hf_smb_service, tvb,
offset, an_len, an);
COUNT_BYTES(an_len);
@@ -7918,7 +7918,7 @@ dissect_tree_connect_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* XXX - what if this runs past bc? */
an_len = tvb_strsize(tvb, offset);
CHECK_BYTE_COUNT(an_len);
- an = tvb_get_ephemeral_string(tvb, offset, an_len);
+ an = tvb_get_string(wmem_packet_scope(), tvb, offset, an_len);
proto_tree_add_string(tree, hf_smb_service, tvb,
offset, an_len, an);
COUNT_BYTES(an_len);
@@ -12100,7 +12100,7 @@ dissect_4_2_16_2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
/* EA name */
- name = tvb_get_ephemeral_string(tvb, offset, name_len);
+ name = tvb_get_string(wmem_packet_scope(), tvb, offset, name_len);
proto_item_append_text(item, ": %s", format_text(name, strlen(name)));
CHECK_BYTE_COUNT_SUBR(name_len + 1);
diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c
index d06ba8dc34..96e58dd2a6 100644
--- a/epan/dissectors/packet-smb2.c
+++ b/epan/dissectors/packet-smb2.c
@@ -6593,7 +6593,7 @@ dissect_smb2_transform_header(packet_info *pinfo _U_, proto_tree *tree,
memcpy(&A_1[1], sti->nonce, 15 - 4);
- plain_data = (guint8 *)tvb_g_memdup(tvb, offset, sti->size);
+ plain_data = (guint8 *)tvb_memdup(NULL, tvb, offset, sti->size);
/* Open the cipher. */
if (gcry_cipher_open(&cipher_hd, GCRY_CIPHER_AES128, GCRY_CIPHER_MODE_CTR, 0)) {
diff --git a/epan/dissectors/packet-smtp.c b/epan/dissectors/packet-smtp.c
index be321fdbad..492b49e53d 100644
--- a/epan/dissectors/packet-smtp.c
+++ b/epan/dissectors/packet-smtp.c
@@ -316,7 +316,7 @@ decode_plain_auth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
gint length_pass;
guint8 *decrypt = NULL;
- decrypt = tvb_get_ephemeral_string(tvb, a_offset, a_linelen);
+ decrypt = tvb_get_string(wmem_packet_scope(), tvb, a_offset, a_linelen);
if (stmp_decryption_enabled) {
returncode = (gint)epan_base64_decode(decrypt);
if (returncode) {
@@ -575,7 +575,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if ((session_state->auth_state != SMTP_AUTH_STATE_NONE) &&
(pinfo->fd->num >= session_state->first_auth_frame) &&
((session_state->last_auth_frame == 0) || (pinfo->fd->num <= session_state->last_auth_frame))) {
- decrypt = tvb_get_ephemeral_string(tvb, loffset, linelen);
+ decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset, linelen);
if ((stmp_decryption_enabled) && (epan_base64_decode(decrypt) > 0)) {
line = decrypt;
} else {
@@ -832,11 +832,11 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (session_state->username_frame == pinfo->fd->num) {
if (decrypt == NULL) {
/* This line wasn't already decrypted through the state machine */
- decrypt = tvb_get_ephemeral_string(tvb, loffset, linelen);
+ decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset, linelen);
if (stmp_decryption_enabled) {
if (epan_base64_decode(decrypt) == 0) {
/* Go back to the original string */
- decrypt = tvb_get_ephemeral_string(tvb, loffset, linelen);
+ decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset, linelen);
}
}
}
@@ -846,11 +846,11 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} else if (session_state->password_frame == pinfo->fd->num) {
if (decrypt == NULL) {
/* This line wasn't already decrypted through the state machine */
- decrypt = tvb_get_ephemeral_string(tvb, loffset, linelen);
+ decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset, linelen);
if (stmp_decryption_enabled) {
if (epan_base64_decode(decrypt) == 0) {
/* Go back to the original string */
- decrypt = tvb_get_ephemeral_string(tvb, loffset, linelen);
+ decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset, linelen);
}
}
}
@@ -858,17 +858,17 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
loffset, linelen, decrypt);
col_append_fstr(pinfo->cinfo, COL_INFO, "Pass: %s", decrypt);
} else if (session_state->ntlm_rsp_frame == pinfo->fd->num) {
- decrypt = tvb_get_ephemeral_string(tvb, loffset, linelen);
+ decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset, linelen);
if (stmp_decryption_enabled) {
if (epan_base64_decode(decrypt) == 0) {
/* Go back to the original string */
- decrypt = tvb_get_ephemeral_string(tvb, loffset, linelen);
+ decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset, linelen);
col_append_str(pinfo->cinfo, COL_INFO, decrypt);
proto_tree_add_item(smtp_tree, hf_smtp_command_line, tvb,
loffset, linelen, ENC_ASCII|ENC_NA);
}
else {
- base64_string = tvb_get_ephemeral_string(tvb, loffset, linelen);
+ base64_string = tvb_get_string(wmem_packet_scope(), tvb, loffset, linelen);
dissect_ntlm_auth(tvb, pinfo, smtp_tree, base64_string);
}
}
@@ -902,53 +902,53 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (decrypt == NULL) {
/* This line wasn't already decrypted through the state machine */
- decrypt = tvb_get_ephemeral_string(tvb, loffset + 11, linelen - 11);
+ decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset + 11, linelen - 11);
if (stmp_decryption_enabled) {
if (epan_base64_decode(decrypt) == 0) {
/* Go back to the original string */
- decrypt = tvb_get_ephemeral_string(tvb, loffset + 11, linelen - 11);
+ decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset + 11, linelen - 11);
}
}
}
proto_tree_add_string(cmdresp_tree, hf_smtp_username, tvb, loffset + 11, linelen - 11, decrypt);
- col_append_str(pinfo->cinfo, COL_INFO, tvb_get_ephemeral_string(tvb, loffset, 11));
+ col_append_str(pinfo->cinfo, COL_INFO, tvb_get_string(wmem_packet_scope(), tvb, loffset, 11));
col_append_fstr(pinfo->cinfo, COL_INFO, "User: %s", decrypt);
}
else if ((linelen > 5) && (session_state->ntlm_req_frame == pinfo->fd->num) ) {
proto_tree_add_item(cmdresp_tree, hf_smtp_req_parameter, tvb,
loffset + 5, linelen - 5, ENC_ASCII|ENC_NA);
- decrypt = tvb_get_ephemeral_string(tvb, loffset + 10, linelen - 10);
+ decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset + 10, linelen - 10);
if (stmp_decryption_enabled) {
if (epan_base64_decode(decrypt) == 0) {
/* Go back to the original string */
- decrypt = tvb_get_ephemeral_string(tvb, loffset + 10, linelen - 10);
- col_append_str(pinfo->cinfo, COL_INFO, tvb_get_ephemeral_string(tvb, loffset, 10));
+ decrypt = tvb_get_string(wmem_packet_scope(), tvb, loffset + 10, linelen - 10);
+ col_append_str(pinfo->cinfo, COL_INFO, tvb_get_string(wmem_packet_scope(), tvb, loffset, 10));
col_append_str(pinfo->cinfo, COL_INFO, decrypt);
}
else {
- base64_string = tvb_get_ephemeral_string(tvb, loffset + 10, linelen - 10);
- col_append_str(pinfo->cinfo, COL_INFO, tvb_get_ephemeral_string(tvb, loffset, 10));
+ base64_string = tvb_get_string(wmem_packet_scope(), tvb, loffset + 10, linelen - 10);
+ col_append_str(pinfo->cinfo, COL_INFO, tvb_get_string(wmem_packet_scope(), tvb, loffset, 10));
dissect_ntlm_auth(tvb, pinfo, cmdresp_tree, base64_string);
}
}
else {
- col_append_str(pinfo->cinfo, COL_INFO, tvb_get_ephemeral_string(tvb, loffset, 10));
+ col_append_str(pinfo->cinfo, COL_INFO, tvb_get_string(wmem_packet_scope(), tvb, loffset, 10));
col_append_str(pinfo->cinfo, COL_INFO, decrypt);
}
}
else if ((linelen > 5) && (session_state->user_pass_cmd_frame == pinfo->fd->num) ) {
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, tvb_get_ephemeral_string(tvb, loffset, 11));
+ col_append_str(pinfo->cinfo, COL_INFO, tvb_get_string(wmem_packet_scope(), 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, tvb_get_ephemeral_string(tvb, loffset, linelen));
+ col_append_str(pinfo->cinfo, COL_INFO, tvb_get_string(wmem_packet_scope(), tvb, loffset, linelen));
}
else {
- col_append_str(pinfo->cinfo, COL_INFO, tvb_get_ephemeral_string(tvb, loffset, linelen));
+ col_append_str(pinfo->cinfo, COL_INFO, tvb_get_string(wmem_packet_scope(), tvb, loffset, linelen));
}
if (smtp_data_desegment && !spd_frame_data->more_frags) {
@@ -1093,10 +1093,10 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
decrypt = NULL;
if (linelen >= 4) {
if ((stmp_decryption_enabled) && (code == 334)) {
- decrypt = tvb_get_ephemeral_string(tvb, offset + 4, linelen - 4);
+ decrypt = tvb_get_string(wmem_packet_scope(), tvb, offset + 4, linelen - 4);
if (epan_base64_decode(decrypt) > 0) {
if (g_ascii_strncasecmp(decrypt, "NTLMSSP", 7) == 0) {
- base64_string = tvb_get_ephemeral_string(tvb, loffset + 4, linelen - 4);
+ base64_string = tvb_get_string(wmem_packet_scope(), tvb, loffset + 4, linelen - 4);
col_append_fstr(pinfo->cinfo, COL_INFO, "%d ", code);
proto_tree_add_string(cmdresp_tree, hf_smtp_rsp_parameter, tvb,
offset + 4, linelen - 4, (const char*)base64_string);
@@ -1118,10 +1118,10 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset + 4, linelen - 4, ENC_ASCII|ENC_NA);
col_append_fstr(pinfo->cinfo, COL_INFO, "%d %s", code,
- tvb_get_ephemeral_string(tvb, offset + 4, linelen - 4));
+ tvb_get_string(wmem_packet_scope(), tvb, offset + 4, linelen - 4));
}
} else {
- col_append_str(pinfo->cinfo, COL_INFO, tvb_get_ephemeral_string(tvb, offset, linelen));
+ col_append_str(pinfo->cinfo, COL_INFO, tvb_get_string(wmem_packet_scope(), tvb, offset, linelen));
}
}
}
diff --git a/epan/dissectors/packet-sna.c b/epan/dissectors/packet-sna.c
index 694d8cc16d..9c70866f6b 100644
--- a/epan/dissectors/packet-sna.c
+++ b/epan/dissectors/packet-sna.c
@@ -2394,7 +2394,7 @@ dissect_control_0e(tvbuff_t *tvb, proto_tree *tree)
if (len <= 0)
return;
- buf = tvb_get_ephemeral_string(tvb, 3, len);
+ buf = tvb_get_string(wmem_packet_scope(), tvb, 3, len);
EBCDIC_to_ASCII(buf, len);
proto_tree_add_string(tree, hf_sna_control_0e_value, tvb, 3, len, (char *)buf);
}
diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c
index 52f5ee23a8..ff54f92de1 100644
--- a/epan/dissectors/packet-snmp.c
+++ b/epan/dissectors/packet-snmp.c
@@ -532,7 +532,7 @@ dissect_snmp_variable_date_and_time(proto_tree *tree,int hfid, tvbuff_t *tvb, in
minutes,
seconds,
deci_seconds,
- tvb_get_ephemeral_string(tvb,offset+8,1),
+ tvb_get_string(wmem_packet_scope(),tvb,offset+8,1),
hour_from_utc,
min_from_utc);
}else{
@@ -712,7 +712,7 @@ dissect_snmp_VarBind(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset,
pt_name = proto_item_add_subtree(pi_name,ett_name);
/* fetch ObjectName and its relative oid_info */
- oid_bytes = (guint8*)ep_tvb_memdup(tvb, name_offset, name_len);
+ oid_bytes = (guint8*)tvb_memdup(wmem_packet_scope(), tvb, name_offset, name_len);
oid_info = oid_get_from_encoded(oid_bytes, name_len, &subids, &oid_matched, &oid_left);
add_oid_debug_subtree(oid_info,pt_name);
@@ -1508,8 +1508,8 @@ get_user_assoc(tvbuff_t* engine_tvb, tvbuff_t* user_tvb)
given_username_len = tvb_length(user_tvb);
given_engine_len = tvb_length(engine_tvb);
if (! ( given_engine_len && given_username_len ) ) return NULL;
- given_username = (guint8*)ep_tvb_memdup(user_tvb,0,-1);
- given_engine = (guint8*)ep_tvb_memdup(engine_tvb,0,-1);
+ given_username = (guint8*)tvb_memdup(wmem_packet_scope(),user_tvb,0,-1);
+ given_engine = (guint8*)tvb_memdup(wmem_packet_scope(),engine_tvb,0,-1);
for (a = localized_ues; a; a = a->next) {
if ( localized_match(a, given_username, given_username_len, given_engine, given_engine_len) ) {
@@ -1568,10 +1568,10 @@ snmp_usm_auth_md5(snmp_usm_params_t* p, guint8** calc_auth_p, guint* calc_auth_l
*error = "Not enough data remaining";
return FALSE;
}
- msg = (guint8*)ep_tvb_memdup(p->msg_tvb,0,msg_len);
+ msg = (guint8*)tvb_memdup(wmem_packet_scope(),p->msg_tvb,0,msg_len);
- auth = (guint8*)ep_tvb_memdup(p->auth_tvb,0,auth_len);
+ auth = (guint8*)tvb_memdup(wmem_packet_scope(),p->auth_tvb,0,auth_len);
start = p->auth_offset - p->start_offset;
end = start + auth_len;
@@ -1633,9 +1633,9 @@ snmp_usm_auth_sha1(snmp_usm_params_t* p _U_, guint8** calc_auth_p, guint* calc_a
*error = "Not enough data remaining";
return FALSE;
}
- msg = (guint8*)ep_tvb_memdup(p->msg_tvb,0,msg_len);
+ msg = (guint8*)tvb_memdup(wmem_packet_scope(),p->msg_tvb,0,msg_len);
- auth = (guint8*)ep_tvb_memdup(p->auth_tvb,0,auth_len);
+ auth = (guint8*)tvb_memdup(wmem_packet_scope(),p->auth_tvb,0,auth_len);
start = p->auth_offset - p->start_offset;
end = start + auth_len;
@@ -1681,7 +1681,7 @@ snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar c
return NULL;
}
- salt = (guint8*)ep_tvb_memdup(p->priv_tvb,0,salt_len);
+ salt = (guint8*)tvb_memdup(wmem_packet_scope(),p->priv_tvb,0,salt_len);
/*
The resulting "salt" is XOR-ed with the pre-IV to obtain the IV.
@@ -1697,7 +1697,7 @@ snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar c
return NULL;
}
- cryptgrm = (guint8*)ep_tvb_memdup(encryptedData,0,-1);
+ cryptgrm = (guint8*)tvb_memdup(wmem_packet_scope(),encryptedData,0,-1);
cleartext = (guint8*)g_malloc(cryptgrm_len);
@@ -1769,7 +1769,7 @@ snmp_usm_priv_aes_common(snmp_usm_params_t* p, tvbuff_t* encryptedData, gchar co
*error = "Not enough data remaining";
return NULL;
}
- cryptgrm = (guint8*)ep_tvb_memdup(encryptedData,0,-1);
+ cryptgrm = (guint8*)tvb_memdup(wmem_packet_scope(),encryptedData,0,-1);
cleartext = (guint8*)g_malloc(cryptgrm_len);
diff --git a/epan/dissectors/packet-socks.c b/epan/dissectors/packet-socks.c
index 5ff360e09a..268e2827b6 100644
--- a/epan/dissectors/packet-socks.c
+++ b/epan/dissectors/packet-socks.c
@@ -265,7 +265,7 @@ static int display_address(tvbuff_t *tvb, int offset, proto_tree *tree) {
gchar* str;
len = tvb_get_guint8(tvb, offset);
- str = tvb_get_ephemeral_string(tvb, offset+1, len);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset+1, len);
proto_tree_add_string(tree, hf_socks_remote_name, tvb, offset, len+1, str);
offset += (len+1);
}
@@ -566,12 +566,12 @@ client_display_socks_v5(tvbuff_t *tvb, int offset, packet_info *pinfo,
case USER_NAME_AUTHENTICATION:
/* process user name */
len = tvb_get_guint8(tvb, offset);
- str = tvb_get_ephemeral_string(tvb, offset+1, len);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset+1, len);
proto_tree_add_string(tree, hf_socks_username, tvb, offset, len+1, str);
offset += (len+1);
len = tvb_get_guint8(tvb, offset);
- str = tvb_get_ephemeral_string(tvb, offset+1, len);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset+1, len);
proto_tree_add_string(tree, hf_socks_password, tvb, offset, len+1, str);
/* offset += (len+1); */
break;
diff --git a/epan/dissectors/packet-soupbintcp.c b/epan/dissectors/packet-soupbintcp.c
index ecbbf65a4d..cdbd6d1c48 100644
--- a/epan/dissectors/packet-soupbintcp.c
+++ b/epan/dissectors/packet-soupbintcp.c
@@ -235,7 +235,7 @@ dissect_soupbintcp_common(
/* If first dissection of Login Accept, save sequence number */
if (pkt_type == 'A' && !PINFO_FD_VISITED(pinfo)) {
- tmp_buf = tvb_get_ephemeral_string(tvb, 13, 20);
+ tmp_buf = tvb_get_string(wmem_packet_scope(), tvb, 13, 20);
next_seq = atoi(tmp_buf);
/* Create new conversation for this session */
@@ -331,7 +331,7 @@ dissect_soupbintcp_common(
tvb, offset, 10, ENC_ASCII|ENC_NA);
offset += 10;
- tmp_buf = tvb_get_ephemeral_string(tvb, offset, 20);
+ tmp_buf = tvb_get_string(wmem_packet_scope(), tvb, offset, 20);
proto_tree_add_string_format_value(soupbintcp_tree,
hf_soupbintcp_next_seq_num,
tvb, offset, 20,
@@ -376,7 +376,7 @@ dissect_soupbintcp_common(
tvb, offset, 10, ENC_ASCII|ENC_NA);
offset += 10;
- tmp_buf = tvb_get_ephemeral_string(tvb, offset, 20);
+ tmp_buf = tvb_get_string(wmem_packet_scope(), tvb, offset, 20);
proto_tree_add_string_format_value(soupbintcp_tree,
hf_soupbintcp_req_seq_num,
tvb, offset, 20,
diff --git a/epan/dissectors/packet-srvloc.c b/epan/dissectors/packet-srvloc.c
index 176083564d..624a046922 100644
--- a/epan/dissectors/packet-srvloc.c
+++ b/epan/dissectors/packet-srvloc.c
@@ -417,7 +417,7 @@ add_v1_string(proto_tree *tree, int hf, tvbuff_t *tvb, int offset, int length,
switch (encoding) {
case CHARSET_ISO_10646_UCS_2:
- unicode_str = tvb_get_ephemeral_unicode_string(tvb, offset, length, ENC_BIG_ENDIAN);
+ unicode_str = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, length, ENC_BIG_ENDIAN);
proto_tree_add_string(tree, hf, tvb, offset, length,
unicode_str);
break;
@@ -441,7 +441,7 @@ add_v1_string(proto_tree *tree, int hf, tvbuff_t *tvb, int offset, int length,
* does not specify (it is a 16-bit integer space)
*
* Does that mean that in SRVLOC, ISO-10646-UCS-2 is always big-endian?
- * If so, can we just use "tvb_get_ephemeral_unicode_string()" and be
+ * If so, can we just use "tvb_get_unicode_string()" and be
* done with it?
*
* XXX - this is also used with CHARSET_UTF_8. Is that a cut-and-pasteo?
@@ -449,7 +449,7 @@ add_v1_string(proto_tree *tree, int hf, tvbuff_t *tvb, int offset, int length,
static const guint8*
unicode_to_bytes(tvbuff_t *tvb, int offset, int length, gboolean endianness)
{
- const guint8 *ascii_text = tvb_get_ephemeral_string(tvb, offset, length);
+ const guint8 *ascii_text = tvb_get_string(wmem_packet_scope(), tvb, offset, length);
int i, j=0;
guint8 c_char, c_char1;
guint8 *byte_array;
@@ -547,14 +547,14 @@ attr_list(proto_tree *tree, int hf, tvbuff_t *tvb, int offset, int length,
break;
}
/* Parse the attribute name */
- tmp = tvb_get_ephemeral_unicode_string(tvb, offset, length-offset, ENC_BIG_ENDIAN);
+ tmp = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, length-offset, ENC_BIG_ENDIAN);
type_len = (int)strcspn(tmp, "=");
- attr_type = tvb_get_ephemeral_unicode_string(tvb, offset, type_len*2, ENC_BIG_ENDIAN);
+ attr_type = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, type_len*2, ENC_BIG_ENDIAN);
proto_tree_add_string(tree, hf, tvb, offset, type_len*2, attr_type);
offset += (type_len*2)+2;
if (strcmp(attr_type, "svcname-ws")==0) {
/* This is the attribute svcname */
- tmp = tvb_get_ephemeral_unicode_string(tvb, offset, length-offset, ENC_BIG_ENDIAN);
+ tmp = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, length-offset, ENC_BIG_ENDIAN);
type_len = (int)strcspn(tmp, ")");
add_v1_string(tree, hf_srvloc_srvrply_svcname, tvb, offset, type_len*2, encoding);
offset += (type_len*2)+4;
@@ -632,7 +632,7 @@ attr_list(proto_tree *tree, int hf, tvbuff_t *tvb, int offset, int length,
break;
case CHARSET_UTF_8:
- type_len = (int)strcspn(tvb_get_ephemeral_string(tvb, offset, length), "=");
+ type_len = (int)strcspn(tvb_get_string(wmem_packet_scope(), tvb, offset, length), "=");
attr_type = unicode_to_bytes(tvb, offset+1, type_len-1, FALSE);
proto_tree_add_string(tree, hf, tvb, offset+1, type_len-1, attr_type);
i=1;
@@ -726,7 +726,7 @@ attr_list2(proto_tree *tree, int hf, tvbuff_t *tvb, int offset, int length, guin
attr_tree = proto_item_add_subtree(ti, ett_srvloc_attr);
/* this will ensure there is a terminating null */
- start = tvb_get_ephemeral_string(tvb, offset, length);
+ start = tvb_get_string(wmem_packet_scope(), tvb, offset, length);
cnt = 0;
x = 0;
diff --git a/epan/dissectors/packet-ssh.c b/epan/dissectors/packet-ssh.c
index 5d98827c98..6d2f221e19 100644
--- a/epan/dissectors/packet-ssh.c
+++ b/epan/dissectors/packet-ssh.c
@@ -1088,7 +1088,7 @@ ssh_dissect_proposal(tvbuff_t *tvb, int offset, proto_tree *tree,
ssh_proto_tree_add_item(tree, hf_index_value, tvb, offset, len,
ENC_ASCII);
if (store)
- *store = tvb_get_seasonal_string(tvb, offset, len);
+ *store = tvb_get_string(wmem_file_scope(), tvb, offset, len);
offset += len;
return offset;
diff --git a/epan/dissectors/packet-stun.c b/epan/dissectors/packet-stun.c
index 3ab74b2edb..d9a97e0e9f 100644
--- a/epan/dissectors/packet-stun.c
+++ b/epan/dissectors/packet-stun.c
@@ -690,7 +690,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
/* Deprecated STUN RFC3489 attributes */
case PASSWORD:
proto_tree_add_item(att_tree, stun_att_password, tvb, offset, att_length, ENC_ASCII|ENC_NA);
- proto_item_append_text(att_tree, " (Deprecated): %s", tvb_get_ephemeral_string(tvb, offset, att_length));
+ proto_item_append_text(att_tree, " (Deprecated): %s", tvb_get_string(wmem_packet_scope(), tvb, offset, att_length));
if (att_length % 4 != 0)
proto_tree_add_uint(att_tree, stun_att_padding,
tvb, offset+att_length, 4-(att_length % 4), 4-(att_length % 4));
@@ -741,11 +741,11 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
case USERNAME:
proto_tree_add_item(att_tree, stun_att_username, tvb, offset, att_length, ENC_ASCII|ENC_NA);
- proto_item_append_text(att_tree, ": %s", tvb_get_ephemeral_string(tvb, offset, att_length));
+ proto_item_append_text(att_tree, ": %s", tvb_get_string(wmem_packet_scope(), tvb, offset, att_length));
col_append_fstr(
pinfo->cinfo, COL_INFO,
" user: %s",
- tvb_get_ephemeral_string(tvb,offset, att_length)
+ tvb_get_string(wmem_packet_scope(), tvb,offset, att_length)
);
if (att_length % 4 != 0)
proto_tree_add_uint(att_tree, stun_att_padding,
@@ -787,11 +787,11 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
break;
proto_tree_add_item(att_tree, stun_att_error_reason, tvb, offset+4, att_length-4, ENC_ASCII|ENC_NA);
- proto_item_append_text(att_tree, ": %s", tvb_get_ephemeral_string(tvb, offset+4, att_length-4));
+ proto_item_append_text(att_tree, ": %s", tvb_get_string(wmem_packet_scope(), tvb, offset+4, att_length-4));
col_append_fstr(
pinfo->cinfo, COL_INFO,
" %s",
- tvb_get_ephemeral_string(tvb, offset+4, att_length-4)
+ tvb_get_string(wmem_packet_scope(), tvb, offset+4, att_length-4)
);
@@ -808,11 +808,11 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
case REALM:
proto_tree_add_item(att_tree, stun_att_realm, tvb, offset, att_length, ENC_ASCII|ENC_NA);
- proto_item_append_text(att_tree, ": %s", tvb_get_ephemeral_string(tvb, offset, att_length));
+ proto_item_append_text(att_tree, ": %s", tvb_get_string(wmem_packet_scope(), tvb, offset, att_length));
col_append_fstr(
pinfo->cinfo, COL_INFO,
" realm: %s",
- tvb_get_ephemeral_string(tvb,offset, att_length)
+ tvb_get_string(wmem_packet_scope(), tvb,offset, att_length)
);
if (att_length % 4 != 0)
proto_tree_add_uint(att_tree, stun_att_padding, tvb, offset+att_length, 4-(att_length % 4), 4-(att_length % 4));
@@ -820,7 +820,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
case NONCE:
proto_tree_add_item(att_tree, stun_att_nonce, tvb, offset, att_length, ENC_ASCII|ENC_NA);
- proto_item_append_text(att_tree, ": %s", tvb_get_ephemeral_string(tvb, offset, att_length));
+ proto_item_append_text(att_tree, ": %s", tvb_get_string(wmem_packet_scope(), tvb, offset, att_length));
col_append_fstr(
pinfo->cinfo, COL_INFO,
" with nonce"
diff --git a/epan/dissectors/packet-sua.c b/epan/dissectors/packet-sua.c
index eded3c25e7..0ca45a16da 100644
--- a/epan/dissectors/packet-sua.c
+++ b/epan/dissectors/packet-sua.c
@@ -567,7 +567,7 @@ dissect_info_string_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto
proto_tree_add_item(parameter_tree, hf_sua_info_string, parameter_tvb, INFO_STRING_OFFSET, info_string_length, ENC_ASCII|ENC_NA);
proto_item_append_text(parameter_item, " (%.*s)", info_string_length,
- tvb_get_ephemeral_string(parameter_tvb, INFO_STRING_OFFSET, info_string_length));
+ tvb_get_string(wmem_packet_scope(), parameter_tvb, INFO_STRING_OFFSET, info_string_length));
}
#define ROUTING_CONTEXT_LENGTH 4
@@ -1480,7 +1480,7 @@ dissect_hostname_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree,
hostname_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
proto_tree_add_item(parameter_tree, source ? hf_sua_source_hostname : hf_sua_dest_hostname, parameter_tvb, HOSTNAME_OFFSET, hostname_length, ENC_ASCII|ENC_NA);
proto_item_append_text(parameter_item, " (%.*s)", hostname_length,
- tvb_get_ephemeral_string(parameter_tvb, HOSTNAME_OFFSET, hostname_length));
+ tvb_get_string(wmem_packet_scope(), parameter_tvb, HOSTNAME_OFFSET, hostname_length));
}
#define IPV6_ADDRESS_LENGTH 16
diff --git a/epan/dissectors/packet-synphasor.c b/epan/dissectors/packet-synphasor.c
index 1d4c89a236..88a9d37aa2 100644
--- a/epan/dissectors/packet-synphasor.c
+++ b/epan/dissectors/packet-synphasor.c
@@ -712,7 +712,7 @@ static int dissect_config_frame(tvbuff_t *tvb, proto_item *config_item)
gint oldoffset = offset; /* to calculate the length of the whole PMU block later */
/* STN with new tree to add the rest of the PMU block */
- str = tvb_get_ephemeral_string(tvb, offset, CHNAM_LEN);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset, CHNAM_LEN);
station_item = proto_tree_add_text(config_tree, tvb, offset, CHNAM_LEN, "Station #%i: \"%s\"", j + 1, str);
station_tree = proto_item_add_subtree(station_item, ett_conf_station);
offset += CHNAM_LEN;
@@ -1191,7 +1191,7 @@ static gint dissect_CHNAM(tvbuff_t *tvb, proto_tree *tree, gint offset, gint cnt
/* dissect the 'cnt' channel names */
for (i = 0; i < cnt; i++) {
char *str;
- str = tvb_get_ephemeral_string(tvb, offset, CHNAM_LEN);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset, CHNAM_LEN);
proto_tree_add_text(temp_tree, tvb, offset, CHNAM_LEN,
"%s #%i: \"%s\"", prefix, i+1, str);
offset += CHNAM_LEN;
diff --git a/epan/dissectors/packet-sysex.c b/epan/dissectors/packet-sysex.c
index ea2911542f..4c94723b4a 100644
--- a/epan/dissectors/packet-sysex.c
+++ b/epan/dissectors/packet-sysex.c
@@ -1026,7 +1026,7 @@ dissect_digitech_procedure(guint8 procedure, const gint offset,
while ((count > 0) && (str_size = tvb_strsize(data_tvb, data_offset)))
{
- tmp_string = tvb_get_ephemeral_string(data_tvb, data_offset, str_size - 1);
+ tmp_string = tvb_get_string(wmem_packet_scope(), data_tvb, data_offset, str_size - 1);
proto_tree_add_string(tree, hf_digitech_preset_name, data_tvb, data_offset, str_size, tmp_string);
data_offset += (gint)str_size;
count--;
@@ -1050,7 +1050,7 @@ dissect_digitech_procedure(guint8 procedure, const gint offset,
/* Preset name (NULL-terminated) */
str_size = tvb_strsize(data_tvb, data_offset);
- tmp_string = tvb_get_ephemeral_string(data_tvb, data_offset, str_size - 1);
+ tmp_string = tvb_get_string(wmem_packet_scope(), data_tvb, data_offset, str_size - 1);
proto_tree_add_string(tree, hf_digitech_preset_name, data_tvb, data_offset, str_size, tmp_string);
data_offset += (gint)str_size;
diff --git a/epan/dissectors/packet-t124.c b/epan/dissectors/packet-t124.c
index a84d0d9508..3acd833698 100644
--- a/epan/dissectors/packet-t124.c
+++ b/epan/dissectors/packet-t124.c
@@ -583,7 +583,7 @@ dissect_t124_T_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, pr
if(next_tvb) {
- ns = tvb_get_g_string(t124NSIdentifier, 0, tvb_length(t124NSIdentifier));
+ ns = tvb_get_string(NULL, t124NSIdentifier, 0, tvb_length(t124NSIdentifier));
if(ns != NULL) {
dissector_try_string(t124_ns_dissector_table, ns, next_tvb, actx->pinfo, top_tree);
g_free(ns);
diff --git a/epan/dissectors/packet-tacacs.c b/epan/dissectors/packet-tacacs.c
index 73e5bca8de..52ad64e8ee 100644
--- a/epan/dissectors/packet-tacacs.c
+++ b/epan/dissectors/packet-tacacs.c
@@ -390,7 +390,7 @@ tacplus_decrypted_tvb_setup( tvbuff_t *tvb, tvbuff_t **dst_tvb, packet_info *pin
tvb_memcpy(tvb, session_id, 4,4);
- buff = (guint8 *)tvb_g_memdup(tvb, TAC_PLUS_HDR_SIZE, len);
+ buff = (guint8 *)tvb_memdup(NULL, tvb, TAC_PLUS_HDR_SIZE, len);
md5_xor( buff, key, len, session_id,version, tvb_get_guint8(tvb,2) );
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index 34b7f71cbe..d93c071c8a 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -4568,7 +4568,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
optlen = tcph->th_hlen - TCPH_MIN_LEN; /* length of options, in bytes */
tvb_ensure_bytes_exist(tvb, offset + 20, optlen);
if (tcp_tree != NULL) {
- guint8 *p_options = (guint8 *)ep_tvb_memdup(tvb, offset + 20, optlen);
+ guint8 *p_options = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, offset + 20, optlen);
tf = proto_tree_add_bytes_format(tcp_tree, hf_tcp_options, tvb, offset + 20,
optlen, p_options, "Options: (%u bytes)", optlen);
field_tree = proto_item_add_subtree(tf, ett_tcp_options);
diff --git a/epan/dissectors/packet-tds.c b/epan/dissectors/packet-tds.c
index ad31433cf7..2cd519afc1 100644
--- a/epan/dissectors/packet-tds.c
+++ b/epan/dissectors/packet-tds.c
@@ -994,9 +994,9 @@ dissect_tds_query_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, td
is_unicode = FALSE;
if (is_unicode)
- msg = tvb_get_ephemeral_unicode_string(tvb, offset, len, ENC_LITTLE_ENDIAN);
+ msg = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, len, ENC_LITTLE_ENDIAN);
else
- msg = (gchar*)tvb_get_ephemeral_string(tvb, offset, len);
+ msg = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, offset, len);
proto_tree_add_text(query_tree, tvb, offset, len, "Query: %s", msg);
offset += len;
@@ -1011,7 +1011,7 @@ dissect_tds5_lang_token(tvbuff_t *tvb, guint offset, guint len, proto_tree *tree
offset += 1;
len -= 1;
- msg = (gchar*)tvb_get_ephemeral_string(tvb, offset, len);
+ msg = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, offset, len);
proto_tree_add_text(tree, tvb, offset, len, "Language text: %s", msg);
}
@@ -1172,7 +1172,7 @@ dissect_tds7_login(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if( i != 2) {
/* tds 7 is always unicode */
len *= 2;
- val = tvb_get_ephemeral_unicode_string(tvb, offset2, len, ENC_LITTLE_ENDIAN);
+ val = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset2, len, ENC_LITTLE_ENDIAN);
proto_tree_add_text(login_tree, tvb, offset2, len, "%s: %s", val_to_str_const(i, login_field_names, "Unknown"), val);
} else {
/* This field is the password. We retrieve it from the packet
@@ -1183,7 +1183,7 @@ dissect_tds7_login(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
len *= 2;
- val = (gchar*)tvb_get_ephemeral_string(tvb, offset2, len);
+ val = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, offset2, len);
val2 = (char *)wmem_alloc(wmem_packet_scope(), len/2+1);
for(j = 0, k = 0; j < len; j += 2, k++) {
@@ -1485,10 +1485,10 @@ dissect_tds_env_chg(tvbuff_t *tvb, guint offset, guint token_sz,
string_offset = offset + 2;
if (is_unicode == TRUE) {
new_len *= 2;
- new_val = tvb_get_ephemeral_unicode_string(tvb, string_offset,
+ new_val = tvb_get_unicode_string(wmem_packet_scope(), tvb, string_offset,
new_len, ENC_LITTLE_ENDIAN);
} else
- new_val = (gchar*)tvb_get_ephemeral_string(tvb, string_offset, new_len);
+ new_val = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, string_offset, new_len);
proto_tree_add_text(tree, tvb, string_offset, new_len,
"New Value: %s", new_val);
}
@@ -1509,10 +1509,10 @@ dissect_tds_env_chg(tvbuff_t *tvb, guint offset, guint token_sz,
string_offset = old_len_offset + 1;
if (is_unicode == TRUE) {
old_len *= 2;
- old_val = tvb_get_ephemeral_unicode_string(tvb, string_offset,
+ old_val = tvb_get_unicode_string(wmem_packet_scope(), tvb, string_offset,
old_len, ENC_LITTLE_ENDIAN);
} else
- old_val = (gchar*)tvb_get_ephemeral_string(tvb, string_offset, old_len);
+ old_val = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, string_offset, old_len);
proto_tree_add_text(tree, tvb, string_offset, old_len,
"Old Value: %s", old_val);
}
@@ -1542,9 +1542,9 @@ dissect_tds_err_token(tvbuff_t *tvb, guint offset, guint token_sz _U_, proto_tre
if(is_unicode) {
msg_len *= 2;
- msg = tvb_get_ephemeral_unicode_string(tvb, offset, msg_len, ENC_LITTLE_ENDIAN);
+ msg = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, msg_len, ENC_LITTLE_ENDIAN);
} else {
- msg = (gchar*)tvb_get_ephemeral_string(tvb, offset, msg_len);
+ msg = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, offset, msg_len);
}
proto_tree_add_text(tree, tvb, offset, msg_len, "Error: %s", format_text((guchar*)msg, strlen(msg)));
offset += msg_len;
@@ -1556,9 +1556,9 @@ dissect_tds_err_token(tvbuff_t *tvb, guint offset, guint token_sz _U_, proto_tre
if(srvr_len) {
if (is_unicode) {
srvr_len *=2;
- msg = tvb_get_ephemeral_unicode_string(tvb, offset, srvr_len, ENC_LITTLE_ENDIAN);
+ msg = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, srvr_len, ENC_LITTLE_ENDIAN);
} else {
- msg = (gchar*)tvb_get_ephemeral_string(tvb, offset, srvr_len);
+ msg = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, offset, srvr_len);
}
proto_tree_add_text(tree, tvb, offset, srvr_len, "Server name: %s", msg);
offset += srvr_len;
@@ -1571,9 +1571,9 @@ dissect_tds_err_token(tvbuff_t *tvb, guint offset, guint token_sz _U_, proto_tre
if(proc_len) {
if (is_unicode) {
proc_len *=2;
- msg = tvb_get_ephemeral_unicode_string(tvb, offset, proc_len, ENC_LITTLE_ENDIAN);
+ msg = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, proc_len, ENC_LITTLE_ENDIAN);
} else {
- msg = (gchar*)tvb_get_ephemeral_string(tvb, offset, proc_len);
+ msg = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, offset, proc_len);
}
proto_tree_add_text(tree, tvb, offset, proc_len, "Process name: %s", msg);
offset += proc_len;
@@ -1626,9 +1626,9 @@ dissect_tds_login_ack_token(tvbuff_t *tvb, guint offset, guint token_sz, proto_t
proto_tree_add_text(tree, tvb, offset, 0, "msg_len: %d, token_sz: %d, total: %d",msg_len, token_sz, msg_len + 6U + 3U);
if(is_unicode) {
msg_len *= 2;
- msg = tvb_get_ephemeral_unicode_string(tvb, offset, msg_len, ENC_LITTLE_ENDIAN);
+ msg = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, msg_len, ENC_LITTLE_ENDIAN);
} else {
- msg = (gchar*)tvb_get_ephemeral_string(tvb, offset, msg_len);
+ msg = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, offset, msg_len);
}
proto_tree_add_text(tree, tvb, offset, msg_len, "Text: %s", format_text((guchar*)msg, strlen(msg)));
offset += msg_len;
@@ -1681,7 +1681,7 @@ dissect_tds7_results_token(tvbuff_t *tvb, guint offset, proto_tree *tree, tds_co
offset +=2;
if(table_len != 0) {
table_len *= 2;
- msg = tvb_get_ephemeral_unicode_string(tvb, offset, table_len, ENC_LITTLE_ENDIAN);
+ msg = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, table_len, ENC_LITTLE_ENDIAN);
proto_tree_add_text(tree, tvb, offset, table_len, "Table name: %s", msg);
offset += table_len;
}
@@ -1707,7 +1707,7 @@ dissect_tds7_results_token(tvbuff_t *tvb, guint offset, proto_tree *tree, tds_co
offset += 1;
if(msg_len != 0) {
msg_len *= 2;
- msg = tvb_get_ephemeral_unicode_string(tvb, offset, msg_len, ENC_LITTLE_ENDIAN);
+ msg = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, msg_len, ENC_LITTLE_ENDIAN);
proto_tree_add_text(tree, tvb, offset, msg_len, "Text: %s", msg);
offset += msg_len;
}
@@ -1909,7 +1909,7 @@ dissect_tds_type_varbyte(tvbuff_t *tvb, guint *offset, packet_info *pinfo, proto
proto_tree_add_item(sub_tree, hf_tds_type_varbyte_data_string, tvb, *offset, length, ENC_ASCII|ENC_NA);
break;
case TDS_DATA_TYPE_NVARCHAR: /* NVarChar */
- string_value = tvb_get_ephemeral_unicode_string(tvb, *offset, length, ENC_LITTLE_ENDIAN);
+ string_value = tvb_get_unicode_string(wmem_packet_scope(), tvb, *offset, length, ENC_LITTLE_ENDIAN);
proto_tree_add_string(sub_tree, hf_tds_type_varbyte_data_string, tvb, *offset, length, string_value);
break;
case TDS_DATA_TYPE_XML: /* XML (introduced in TDS 7.2) */
@@ -2063,7 +2063,7 @@ dissect_tds_type_varbyte(tvbuff_t *tvb, guint *offset, packet_info *pinfo, proto
break;
case TDS_DATA_TYPE_NVARCHAR: /* NVarChar */
case TDS_DATA_TYPE_NCHAR: /* NChar */
- string_value = tvb_get_ephemeral_unicode_string(tvb, *offset, length, ENC_LITTLE_ENDIAN);
+ string_value = tvb_get_unicode_string(wmem_packet_scope(), tvb, *offset, length, ENC_LITTLE_ENDIAN);
proto_tree_add_string(sub_tree, hf_tds_type_varbyte_data_string, tvb, *offset, length, string_value);
break;
default:
@@ -2090,7 +2090,7 @@ dissect_tds_type_varbyte(tvbuff_t *tvb, guint *offset, packet_info *pinfo, proto
else {
switch(data_type) {
case TDS_DATA_TYPE_NTEXT: /* NText */
- string_value = tvb_get_ephemeral_unicode_string(tvb, *offset, length, ENC_LITTLE_ENDIAN);
+ string_value = tvb_get_unicode_string(wmem_packet_scope(), tvb, *offset, length, ENC_LITTLE_ENDIAN);
proto_tree_add_string(sub_tree, hf_tds_type_varbyte_data_string, tvb, *offset, length, string_value);
break;
default: /*TODO*/
@@ -2145,7 +2145,7 @@ dissect_tds_rpc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
else if (len != 0) {
len *= 2;
- val = tvb_get_ephemeral_unicode_string(tvb, offset, len, ENC_LITTLE_ENDIAN);
+ val = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, len, ENC_LITTLE_ENDIAN);
proto_tree_add_string(tree, hf_tds_rpc_name, tvb, offset, len, val);
offset += len;
}
@@ -2175,7 +2175,7 @@ dissect_tds_rpc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
++offset;
if(len) {
len *= 2;
- val = tvb_get_ephemeral_unicode_string(tvb, offset, len, ENC_LITTLE_ENDIAN);
+ val = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, len, ENC_LITTLE_ENDIAN);
proto_tree_add_string(sub_tree, hf_tds_rpc_parameter_name, tvb, offset, len, val);
offset += len;
}
diff --git a/epan/dissectors/packet-telnet.c b/epan/dissectors/packet-telnet.c
index fe0b888d72..469492cdd4 100644
--- a/epan/dissectors/packet-telnet.c
+++ b/epan/dissectors/packet-telnet.c
@@ -661,7 +661,7 @@ dissect_comport_subopt(packet_info *pinfo, const char *optname, tvbuff_t *tvb, i
if (len == 0) {
proto_tree_add_text(tree, tvb, offset, 1, "%s Requests Signature",source);
} else {
- guint8 *sig = tvb_get_ephemeral_string(tvb, offset + 1, len);
+ guint8 *sig = tvb_get_string(wmem_packet_scope(), tvb, offset + 1, len);
proto_tree_add_string_format_value(tree, hf_telnet_comport_subopt_signature, tvb, offset, 1 + len, sig,
"%s Signature: %s",source, sig);
}
diff --git a/epan/dissectors/packet-tftp.c b/epan/dissectors/packet-tftp.c
index 03c84ea017..3c98eb5f49 100644
--- a/epan/dissectors/packet-tftp.c
+++ b/epan/dissectors/packet-tftp.c
@@ -208,7 +208,7 @@ static void dissect_tftp_message(tftp_conv_info_t *tftp_info,
proto_tree_add_item(tftp_tree, hf_tftp_source_file,
tvb, offset, i1, ENC_ASCII|ENC_NA);
- tftp_info->source_file = tvb_get_seasonal_string(tvb, offset, i1);
+ tftp_info->source_file = tvb_get_string(wmem_file_scope(), tvb, offset, i1);
col_append_fstr(pinfo->cinfo, COL_INFO, ", File: %s",
tvb_format_stringzpad(tvb, offset, i1));
@@ -234,7 +234,7 @@ static void dissect_tftp_message(tftp_conv_info_t *tftp_info,
tvb, offset, i1, ENC_ASCII|ENC_NA);
tftp_info->destination_file =
- tvb_get_seasonal_string(tvb, offset, i1);
+ tvb_get_string(wmem_file_scope(), tvb, offset, i1);
col_append_fstr(pinfo->cinfo, COL_INFO, ", File: %s",
tvb_format_stringzpad(tvb, offset, i1));
diff --git a/epan/dissectors/packet-tivoconnect.c b/epan/dissectors/packet-tivoconnect.c
index e6abb1e13b..7afb981ff8 100644
--- a/epan/dissectors/packet-tivoconnect.c
+++ b/epan/dissectors/packet-tivoconnect.c
@@ -80,7 +80,7 @@ dissect_tivoconnect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
}
length = tvb_length(tvb);
- string = (gchar*)tvb_get_ephemeral_string(tvb, 0, length);
+ string = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, 0, length);
/* Make entries in Protocol column and Info column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "TiVoConnect");
diff --git a/epan/dissectors/packet-tnef.c b/epan/dissectors/packet-tnef.c
index d40c071880..8dcd9efe9f 100644
--- a/epan/dissectors/packet-tnef.c
+++ b/epan/dissectors/packet-tnef.c
@@ -270,7 +270,7 @@ static gint dissect_counted_values(tvbuff_t *tvb, gint offset, int hf_id, packe
offset += 4;
if (unicode) {
- char *unicode_str = tvb_get_ephemeral_unicode_string(tvb, offset, length, ENC_LITTLE_ENDIAN);
+ char *unicode_str = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, length, ENC_LITTLE_ENDIAN);
proto_tree_add_string(tree, hf_id, tvb, offset, length, unicode_str);
} else {
proto_tree_add_item(tree, hf_id, tvb, offset, length, encoding);
@@ -407,7 +407,7 @@ static void dissect_mapiprops(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
proto_tree_add_item(tag_tree, hf_tnef_property_tag_name_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset += 4;
- name_string = tvb_get_ephemeral_unicode_string (tvb, offset, tag_length, ENC_LITTLE_ENDIAN);
+ name_string = tvb_get_unicode_string (wmem_packet_scope(), tvb, offset, tag_length, ENC_LITTLE_ENDIAN);
proto_tree_add_string_format(tag_tree, hf_tnef_property_tag_name_string, tvb, offset,
tag_length, name_string, "Name: %s", name_string);
offset += tag_length;
@@ -613,7 +613,7 @@ static void dissect_tnef(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
case ATP_STRING:
proto_tree_add_item(attr_tree, hf_tnef_attribute_string, tvb, offset, length, ENC_ASCII|ENC_NA);
- proto_item_append_text(attr_item, " %s", tvb_get_ephemeral_string(tvb, offset, length));
+ proto_item_append_text(attr_item, " %s", tvb_get_string(wmem_packet_scope(), tvb, offset, length));
break;
default:
proto_tree_add_item(attr_tree, hf_tnef_attribute_value, tvb, offset, length, ENC_NA);
diff --git a/epan/dissectors/packet-ucp.c b/epan/dissectors/packet-ucp.c
index ea73ce11ed..178418e356 100644
--- a/epan/dissectors/packet-ucp.c
+++ b/epan/dissectors/packet-ucp.c
@@ -875,7 +875,7 @@ ucp_handle_int(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
tvb_ensure_bytes_exist(tvb, *offset, len + 1);
} else
len = idx - *offset;
- strval = tvb_get_ephemeral_string(tvb, *offset, len);
+ strval = tvb_get_string(wmem_packet_scope(), tvb, *offset, len);
if (len > 0) {
intval = atoi(strval);
proto_tree_add_uint(tree, field, tvb, *offset, len, intval);
@@ -901,7 +901,7 @@ ucp_handle_time(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
tvb_ensure_bytes_exist(tvb, *offset, len + 1);
} else
len = idx - *offset;
- strval = tvb_get_ephemeral_string(tvb, *offset, len);
+ strval = tvb_get_string(wmem_packet_scope(), tvb, *offset, len);
if (len > 0) {
tval = ucp_mktime(strval);
tmptime.secs = tval;
diff --git a/epan/dissectors/packet-uma.c b/epan/dissectors/packet-uma.c
index 89fba833df..0163a1995a 100644
--- a/epan/dissectors/packet-uma.c
+++ b/epan/dissectors/packet-uma.c
@@ -974,7 +974,7 @@ dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
break;
case 10: /* UNC SGW Fully Qualified Domain/Host Name */
if ( ie_len > 0){
- string = (gchar*)tvb_get_ephemeral_string(tvb, ie_offset, ie_len);
+ string = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, ie_offset, ie_len);
proto_tree_add_string(urr_ie_tree, hf_uma_urr_FQDN, tvb, ie_offset, ie_len, string);
}else{
proto_tree_add_text(urr_ie_tree,tvb,offset,1,"FQDN not present");
@@ -1440,7 +1440,7 @@ dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
case 98:
/* UNC Fully Qualified Domain/Host Name */
if ( ie_len > 0){
- string = (gchar*)tvb_get_ephemeral_string(tvb, ie_offset, ie_len);
+ string = (gchar*)tvb_get_string(wmem_packet_scope(), tvb, ie_offset, ie_len);
proto_tree_add_string(urr_ie_tree, hf_uma_unc_FQDN, tvb, ie_offset, ie_len, string);
}else{
proto_tree_add_text(urr_ie_tree,tvb,offset,1,"UNC FQDN not present");
diff --git a/epan/dissectors/packet-umts_fp.c b/epan/dissectors/packet-umts_fp.c
index 6783402575..6ba3e1b453 100644
--- a/epan/dissectors/packet-umts_fp.c
+++ b/epan/dissectors/packet-umts_fp.c
@@ -593,7 +593,7 @@ static gboolean verify_control_frame_crc(tvbuff_t * tvb, packet_info * pinfo, pr
guint8 crc = 0;
guint8 * data = NULL;
/* Get data. */
- data = tvb_get_ephemeral_string(tvb, 0, tvb_length(tvb));
+ data = tvb_get_string(wmem_packet_scope(), tvb, 0, tvb_length(tvb));
/* Include only FT flag bit in CRC calculation. */
data[0] = data[0] & 1;
/* Calculate crc7 sum. */
@@ -613,7 +613,7 @@ static gboolean verify_header_crc(tvbuff_t * tvb, packet_info * pinfo, proto_ite
guint8 crc = 0;
guint8 * data = NULL;
/* Get data of header with first byte removed. */
- data = tvb_get_ephemeral_string(tvb, 1, header_length-1);
+ data = tvb_get_string(wmem_packet_scope(), tvb, 1, header_length-1);
/* Calculate crc7 sum. */
crc = crc7update(0, data, header_length-1);
crc = crc7finalize(crc); /* finalize crc */
@@ -633,7 +633,7 @@ static gboolean verify_header_crc_edch(tvbuff_t * tvb, packet_info * pinfo, prot
/* First create new subset of header with first byte removed. */
tvbuff_t * headtvb = tvb_new_subset(tvb, 1, header_length-1, header_length-1);
/* Get data of header with first byte removed. */
- data = tvb_get_ephemeral_string(headtvb, 0, header_length-1);
+ data = tvb_get_string(wmem_packet_scope(), headtvb, 0, header_length-1);
/* Remove first 4 bits of the remaining data which are Header CRC cont. */
data[0] = data[0] & 0x0f;
crc = crc11_307_noreflect_noxor(data, header_length-1);
@@ -980,7 +980,7 @@ dissect_spare_extension_and_crc(tvbuff_t *tvb, packet_info *pinfo,
ENC_BIG_ENDIAN);
if (preferences_payload_checksum) {
guint16 calc_crc, read_crc;
- guint8 * data = tvb_get_ephemeral_string(tvb, header_length, offset-header_length);
+ guint8 * data = tvb_get_string(wmem_packet_scope(), tvb, header_length, offset-header_length);
calc_crc = crc16_8005_noreflect_noxor(data, offset-header_length);
read_crc = tvb_get_bits16(tvb, offset*8, 16, FALSE);
@@ -3753,7 +3753,7 @@ heur_dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
* with the corresponding generator polynomial: G(D) = D7+D6+D2+1. See subclause 7.2.
*/
length = tvb_length(tvb);
- buf = (unsigned char *)ep_tvb_memdup(tvb, 0, length);
+ buf = (unsigned char *)tvb_memdup(wmem_packet_scope(), tvb, 0, length);
buf[0] = 01;
calc_crc = crc7update(calc_crc, buf, length);
diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c
index bd46c9bb71..dfa4642405 100644
--- a/epan/dissectors/packet-usb.c
+++ b/epan/dissectors/packet-usb.c
@@ -1423,14 +1423,14 @@ dissect_usb_string_descriptor(packet_info *pinfo _U_, proto_tree *parent_tree,
char *str;
guint8 str_len;
- /* Make sure that tvb_get_ephemeral_unicode_string() gets an even
+ /* Make sure that tvb_get_unicode_string() gets an even
string length even if the length field contains an (invalid)
odd number.
*/
str_len = (len-2) & ~0x1;
/* unicode string */
- str = tvb_get_ephemeral_unicode_string(tvb, offset, str_len, ENC_LITTLE_ENDIAN);
+ str = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, str_len, ENC_LITTLE_ENDIAN);
proto_tree_add_string(tree, hf_usb_bString, tvb, offset, len-2, str);
offset += len-2;
}
diff --git a/epan/dissectors/packet-uts.c b/epan/dissectors/packet-uts.c
index 60281d98a2..e433f58ed8 100644
--- a/epan/dissectors/packet-uts.c
+++ b/epan/dissectors/packet-uts.c
@@ -302,7 +302,7 @@ dissect_uts(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
if (etx_start)
length = (etx_start - stx_start - 1); /* and the data part is the rest... */
/* whatever preceeds the ETX if it exists */
- data_ptr = tvb_get_ephemeral_string(tvb, stx_start+1, length); /* copy the string for dissecting */
+ data_ptr = tvb_get_string(wmem_packet_scope(), tvb, stx_start+1, length); /* copy the string for dissecting */
proto_tree_add_string_format(uts_tree, hf_data, tvb, stx_start + 1, length, data_ptr,
"Text (%d byte%s)", length, plurality(length, "", "s"));
}
diff --git a/epan/dissectors/packet-v5ua.c b/epan/dissectors/packet-v5ua.c
index 5d35fb0ac6..52ff154919 100644
--- a/epan/dissectors/packet-v5ua.c
+++ b/epan/dissectors/packet-v5ua.c
@@ -196,7 +196,7 @@ dissect_text_interface_identifier_parameter(tvbuff_t *parameter_tvb, proto_tree
proto_tree_add_item(parameter_tree, hf_text_if_id, parameter_tvb, TEXT_IF_ID_VALUE_OFFSET, if_id_length, ENC_ASCII|ENC_NA);
proto_item_append_text(parameter_item, " (0x%.*s)", if_id_length,
- tvb_get_ephemeral_string(parameter_tvb, TEXT_IF_ID_VALUE_OFFSET, if_id_length));
+ tvb_get_string(wmem_packet_scope(), parameter_tvb, TEXT_IF_ID_VALUE_OFFSET, if_id_length));
}
/*----------------------Text Interface Identifier (RFC)------------------------*/
@@ -506,7 +506,7 @@ dissect_asp_msg_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, p
proto_tree_add_item(parameter_tree, hf_adaptation_layer_id, parameter_tvb, PARAMETER_VALUE_OFFSET, adaptation_layer_id_length, ENC_ASCII|ENC_NA);
proto_item_append_text(parameter_item, " (%.*s)", adaptation_layer_id_length,
- tvb_get_ephemeral_string(parameter_tvb, PARAMETER_VALUE_OFFSET, adaptation_layer_id_length));
+ tvb_get_string(wmem_packet_scope(), parameter_tvb, PARAMETER_VALUE_OFFSET, adaptation_layer_id_length));
}
static void
@@ -515,7 +515,7 @@ dissect_scn_protocol_id_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter
guint16 id_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET);
proto_tree_add_item(parameter_tree, hf_scn_protocol_id, parameter_tvb, PARAMETER_VALUE_OFFSET, id_length, ENC_ASCII|ENC_NA);
proto_item_append_text(parameter_item, " (%.*s)", id_length,
- tvb_get_ephemeral_string(parameter_tvb, PARAMETER_VALUE_OFFSET, id_length));
+ tvb_get_string(wmem_packet_scope(), parameter_tvb, PARAMETER_VALUE_OFFSET, id_length));
}
/*----------------------ASP (Draft)--------------------------------------------*/
@@ -807,7 +807,7 @@ dissect_info_string_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tre
info_string_length -= PARAMETER_HEADER_LENGTH;
proto_tree_add_item(parameter_tree, hf_info_string, parameter_tvb, INFO_STRING_OFFSET, info_string_length, ENC_ASCII|ENC_NA);
proto_item_append_text(parameter_item, " (%.*s)", info_string_length,
- tvb_get_ephemeral_string(parameter_tvb, INFO_STRING_OFFSET, info_string_length));
+ tvb_get_string(wmem_packet_scope(), parameter_tvb, INFO_STRING_OFFSET, info_string_length));
}
}
diff --git a/epan/dissectors/packet-vnc.c b/epan/dissectors/packet-vnc.c
index a9a6ea6a13..90c6a89b9c 100644
--- a/epan/dissectors/packet-vnc.c
+++ b/epan/dissectors/packet-vnc.c
@@ -890,7 +890,7 @@ process_vendor(proto_tree *tree, gint hfindex, tvbuff_t *tvb, gint offset)
proto_item *ti;
if (tree) {
- vendor = tvb_get_ephemeral_string(tvb, offset, 4);
+ vendor = tvb_get_string(wmem_packet_scope(), tvb, offset, 4);
ti = proto_tree_add_string(tree, hfindex, tvb, offset, 4, vendor);
@@ -923,7 +923,7 @@ process_tight_capabilities(proto_tree *tree,
offset = process_vendor(tree, vendor_index, tvb, offset);
- name = tvb_get_ephemeral_string(tvb, offset, 8);
+ name = tvb_get_string(wmem_packet_scope(), tvb, offset, 8);
proto_tree_add_string(tree, name_index, tvb, offset, 8, name);
offset += 8;
}
@@ -1029,7 +1029,7 @@ vnc_startup_messages(tvbuff_t *tvb, packet_info *pinfo, gint offset,
proto_tree_add_item(tree, hf_vnc_server_proto_ver, tvb, 4,
7, ENC_ASCII|ENC_NA);
per_conversation_info->server_proto_ver =
- g_ascii_strtod((char *)tvb_get_ephemeral_string(tvb, 4, 7), NULL);
+ g_ascii_strtod((char *)tvb_get_string(wmem_packet_scope(), tvb, 4, 7), NULL);
per_conversation_info->server_port = pinfo->srcport;
col_add_fstr(pinfo->cinfo, COL_INFO,
@@ -1046,7 +1046,7 @@ vnc_startup_messages(tvbuff_t *tvb, packet_info *pinfo, gint offset,
proto_tree_add_item(tree, hf_vnc_client_proto_ver, tvb,
4, 7, ENC_ASCII|ENC_NA);
per_conversation_info->client_proto_ver =
- g_ascii_strtod((char *)tvb_get_ephemeral_string(tvb, 4, 7), NULL);
+ g_ascii_strtod((char *)tvb_get_string(wmem_packet_scope(), tvb, 4, 7), NULL);
col_add_fstr(pinfo->cinfo, COL_INFO,
"Client protocol version: %s",
@@ -1198,10 +1198,10 @@ vnc_startup_messages(tvbuff_t *tvb, packet_info *pinfo, gint offset,
auth_code = tvb_get_ntohl(tvb, offset);
auth_item = proto_tree_add_item(tree, hf_vnc_tight_auth_code, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
- vendor = tvb_get_ephemeral_string(tvb, offset, 4);
+ vendor = tvb_get_string(wmem_packet_scope(), tvb, offset, 4);
process_vendor(tree, hf_vnc_tight_server_vendor, tvb, offset);
offset += 4;
- signature = tvb_get_ephemeral_string(tvb, offset, 8);
+ signature = tvb_get_string(wmem_packet_scope(), tvb, offset, 8);
proto_tree_add_text(tree, tvb, offset, 8, "Signature: %s", signature);
offset += 8;
diff --git a/epan/dissectors/packet-vtp.c b/epan/dissectors/packet-vtp.c
index 8cf5cebe8d..5e2a64db46 100644
--- a/epan/dissectors/packet-vtp.c
+++ b/epan/dissectors/packet-vtp.c
@@ -178,7 +178,7 @@ dissect_vtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(vtp_tree, hf_vtp_upd_id, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
- upd_timestamp = tvb_get_ephemeral_string(tvb, offset, 12);
+ upd_timestamp = tvb_get_string(wmem_packet_scope(), tvb, offset, 12);
proto_tree_add_string_format(vtp_tree, hf_vtp_upd_ts, tvb,
offset, 12, (gchar*)upd_timestamp,
"Update Timestamp: %.2s-%.2s-%.2s %.2s:%.2s:%.2s",
diff --git a/epan/dissectors/packet-wol.c b/epan/dissectors/packet-wol.c
index c531d1f406..2969acc015 100644
--- a/epan/dissectors/packet-wol.c
+++ b/epan/dissectors/packet-wol.c
@@ -120,7 +120,7 @@ dissect_wol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
/* So far so good. Now get the next 6 bytes, which we'll assume is the
* target's MAC address, and do 15 memory chunk comparisons, since if this
* is a real MagicPacket, the target's MAC will be duplicated 16 times. */
- mac = (guint8 *)ep_tvb_memdup(tvb, 6, 6);
+ mac = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 6, 6);
for ( offset = 12; offset < 102; offset += 6 )
if ( tvb_memeql(tvb, offset, mac, 6) != 0 )
return (0);
diff --git a/epan/dissectors/packet-wow.c b/epan/dissectors/packet-wow.c
index 6b71ec0b0f..7002635240 100644
--- a/epan/dissectors/packet-wow.c
+++ b/epan/dissectors/packet-wow.c
@@ -230,7 +230,7 @@ dissect_wow_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- string = g_strreverse(tvb_get_ephemeral_string(tvb, offset, 4));
+ string = g_strreverse(tvb_get_string(wmem_packet_scope(), tvb, offset, 4));
proto_tree_add_string(wow_tree, hf_wow_gamename,
tvb, offset, 4, string);
offset += 4;
@@ -251,17 +251,17 @@ dissect_wow_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- string = g_strreverse(tvb_get_ephemeral_string(tvb, offset, 4));
+ string = g_strreverse(tvb_get_string(wmem_packet_scope(), tvb, offset, 4));
proto_tree_add_string(wow_tree, hf_wow_platform,
tvb, offset, 4, string);
offset += 4;
- string = g_strreverse(tvb_get_ephemeral_string(tvb, offset, 4));
+ string = g_strreverse(tvb_get_string(wmem_packet_scope(), tvb, offset, 4));
proto_tree_add_string(wow_tree, hf_wow_os, tvb,
offset, 4, string);
offset += 4;
- string = g_strreverse(tvb_get_ephemeral_string(tvb, offset, 4));
+ string = g_strreverse(tvb_get_string(wmem_packet_scope(), tvb, offset, 4));
proto_tree_add_string(wow_tree, hf_wow_country,
tvb, offset, 4, string);
offset += 4;
diff --git a/epan/dissectors/packet-wps.c b/epan/dissectors/packet-wps.c
index f3dc951880..9d9b4974ec 100644
--- a/epan/dissectors/packet-wps.c
+++ b/epan/dissectors/packet-wps.c
@@ -1625,7 +1625,7 @@ dissect_wps_tlvs(proto_tree *eap_tree, tvbuff_t *tvb, int offset,
break;
case FT_STRING:
fmt = ": %s";
- valuep = tvb_get_ephemeral_string(tvb, offset+4, tlv_len);
+ valuep = tvb_get_string(wmem_packet_scope(), tvb, offset+4, tlv_len);
break;
default:
/* make compiler happy */
diff --git a/epan/dissectors/packet-wsp.c b/epan/dissectors/packet-wsp.c
index 76bc584eb2..0d74154fbb 100644
--- a/epan/dissectors/packet-wsp.c
+++ b/epan/dissectors/packet-wsp.c
@@ -1781,7 +1781,7 @@ add_headers (proto_tree *tree, tvbuff_t *tvb, int hf, packet_info *pinfo)
tvb, offset, 2, codepage);
offset += 2;
} else if (hdr_id >= 0x20) { /* Textual header */
- /* Header name MUST be NUL-ended string ==> tvb_get_g_stringz() */
+ /* Header name MUST be NUL-ended string ==> tvb_get_stringz() */
hdr_str = (gchar *)tvb_get_ephemeral_stringz(tvb, hdr_start, (gint *)&hdr_len);
val_start = hdr_start + hdr_len;
val_id = tvb_get_guint8(tvb, val_start);
@@ -5809,7 +5809,7 @@ add_post_variable (proto_tree *tree, tvbuff_t *tvb, guint variableStart, guint v
char *variableBuffer;
char *valueBuffer;
- variableBuffer = tvb_get_ephemeral_string(tvb, variableStart, variableLength);
+ variableBuffer = tvb_get_string(wmem_packet_scope(), tvb, variableStart, variableLength);
if (valueEnd < valueStart)
{
@@ -5822,7 +5822,7 @@ add_post_variable (proto_tree *tree, tvbuff_t *tvb, guint variableStart, guint v
valueLength = valueEnd-valueStart;
/* XXX - if this throws an exception, "variableBuffer"
is leaked */
- valueBuffer = tvb_get_ephemeral_string(tvb, valueStart, valueLength);
+ valueBuffer = tvb_get_string(wmem_packet_scope(), tvb, valueStart, valueLength);
}
/* Check for variables with no value */
diff --git a/epan/dissectors/packet-x11.c b/epan/dissectors/packet-x11.c
index d92fb303c8..703547ae97 100644
--- a/epan/dissectors/packet-x11.c
+++ b/epan/dissectors/packet-x11.c
@@ -2099,7 +2099,7 @@ static void listOfString8(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
while(length--) {
guint l = VALUE8(tvb, *offsetp);
- s = tvb_get_ephemeral_string(tvb, *offsetp + 1, l);
+ s = tvb_get_string(wmem_packet_scope(), tvb, *offsetp + 1, l);
proto_tree_add_string_format(tt, hf_item, tvb, *offsetp, l + 1, s, "\"%s\"", s);
*offsetp += l + 1;
}
@@ -2198,7 +2198,7 @@ static void listOfTextItem(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
proto_tree *ttt;
gint8 delta = VALUE8(tvb, *offsetp + 1);
if (sizeIs16) l += l;
- s = tvb_get_ephemeral_string(tvb, *offsetp + 2, l);
+ s = tvb_get_string(wmem_packet_scope(), tvb, *offsetp + 2, l);
tti = proto_tree_add_none_format(tt, hf_x11_textitem_string, tvb, *offsetp, l + 2,
"textitem (string): delta = %d, \"%s\"",
delta, s);
@@ -3184,7 +3184,7 @@ static void dissect_x11_request(tvbuff_t *tvb, packet_info *pinfo,
/* necessary processing even if tree == NULL */
v16 = VALUE16(tvb, 4);
- name = tvb_get_seasonal_string(tvb, 8, v16);
+ name = tvb_get_string(wmem_file_scope(), tvb, 8, v16);
/* store string of extension, opcode will be set at reply */
i = 0;
diff --git a/epan/dissectors/packet-x509sat.c b/epan/dissectors/packet-x509sat.c
index ea4f345431..a1988793a6 100644
--- a/epan/dissectors/packet-x509sat.c
+++ b/epan/dissectors/packet-x509sat.c
@@ -1516,7 +1516,7 @@ dissect_x509sat_SyntaxBMPString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
if (! wide_tvb) {
return offset;
}
- string = tvb_get_ephemeral_unicode_string (wide_tvb, 0, tvb_length(wide_tvb), ENC_BIG_ENDIAN);
+ string = tvb_get_unicode_string (wmem_packet_scope(), wide_tvb, 0, tvb_length(wide_tvb), ENC_BIG_ENDIAN);
proto_item_append_text(actx->created_item, " %s", string);
diff --git a/epan/dissectors/packet-xcsl.c b/epan/dissectors/packet-xcsl.c
index 6990e1154c..e9f07c04a2 100644
--- a/epan/dissectors/packet-xcsl.c
+++ b/epan/dissectors/packet-xcsl.c
@@ -273,7 +273,7 @@ static gboolean dissect_xcsl_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_t
guint8 *protocol;
if (tvb_length_remaining (tvb, offset) >= 5) {
- protocol = tvb_get_ephemeral_string(tvb, offset, 5);
+ protocol = tvb_get_string(wmem_packet_scope(), tvb, offset, 5);
if (strncmp(protocol,"xcsl",4) == 0 && (protocol[4] == ';' || protocol[4] == '-')) {
diff --git a/epan/dissectors/packet-xdmcp.c b/epan/dissectors/packet-xdmcp.c
index 9048315e06..930e27756d 100644
--- a/epan/dissectors/packet-xdmcp.c
+++ b/epan/dissectors/packet-xdmcp.c
@@ -124,7 +124,7 @@ static gint xdmcp_add_string(proto_tree *tree, gint hf,
guint len;
len = tvb_get_ntohs(tvb, offset);
- str = tvb_get_ephemeral_string(tvb, offset+2, len);
+ str = tvb_get_string(wmem_packet_scope(), tvb, offset+2, len);
proto_tree_add_string(tree, hf, tvb, offset, len+2, str);
return len+2;
diff --git a/epan/dissectors/packet-xmcp.c b/epan/dissectors/packet-xmcp.c
index 0355a8fc72..82e7e2309c 100644
--- a/epan/dissectors/packet-xmcp.c
+++ b/epan/dissectors/packet-xmcp.c
@@ -439,14 +439,14 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
proto_tree_add_item(attr_tree, xmcp_attr_username, tvb, offset,
attr_length, ENC_ASCII|ENC_NA);
proto_item_append_text(attr_tree, ": %s",
- tvb_get_ephemeral_string(tvb, offset, attr_length));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, attr_length));
/*
* Many message methods may include this attribute,
* but it's only interesting when Registering at first
*/
if (xmcp_msg_type_method == XMCP_METHOD_REGISTER) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", user \"%s\"",
- tvb_get_ephemeral_string(tvb, offset, attr_length));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, attr_length));
}
break;
case XMCP_MESSAGE_INTEGRITY:
@@ -509,7 +509,7 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
proto_tree_add_item(attr_tree, xmcp_attr_error_reason, tvb, (offset+4),
(attr_length - 4), ENC_ASCII|ENC_NA);
proto_item_append_text(attr_tree, " (%s)",
- tvb_get_ephemeral_string(tvb, (offset+4),
+ tvb_get_string(wmem_packet_scope(), tvb, (offset+4),
(attr_length-4)));
break;
case XMCP_REALM:
@@ -517,7 +517,7 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
attr_length, ENC_ASCII|ENC_NA);
{
guint8 *realm;
- realm = tvb_get_ephemeral_string(tvb, offset, attr_length);
+ realm = tvb_get_string(wmem_packet_scope(), tvb, offset, attr_length);
proto_item_append_text(attr_tree, ": %s", realm);
/* In XMCP the REALM string should always be "SAF" including the quotes */
if (attr_length != 5 || strncmp(realm, "\"SAF\"", attr_length)) {
@@ -529,15 +529,15 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
proto_tree_add_item(attr_tree, xmcp_attr_nonce, tvb, offset,
attr_length, ENC_ASCII|ENC_NA);
proto_item_append_text(attr_tree, ": %s",
- tvb_get_ephemeral_string(tvb, offset, attr_length));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, attr_length));
break;
case XMCP_CLIENT_NAME:
proto_tree_add_item(attr_tree, xmcp_attr_client_name, tvb, offset,
attr_length, ENC_ASCII|ENC_NA);
proto_item_append_text(attr_tree, ": %s",
- tvb_get_ephemeral_string(tvb, offset, attr_length));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, attr_length));
col_append_fstr(pinfo->cinfo, COL_INFO, ", name \"%s\"",
- tvb_get_ephemeral_string(tvb, offset, attr_length));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, attr_length));
break;
case XMCP_CLIENT_HANDLE:
if (attr_length < 4)
@@ -578,9 +578,9 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
proto_tree_add_item(attr_tree, xmcp_attr_client_label, tvb, offset,
attr_length, ENC_ASCII|ENC_NA);
proto_item_append_text(attr_tree, ": %s",
- tvb_get_ephemeral_string(tvb, offset, attr_length));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, attr_length));
col_append_fstr(pinfo->cinfo, COL_INFO, ", label \"%s\"",
- tvb_get_ephemeral_string(tvb, offset, attr_length));
+ tvb_get_string(wmem_packet_scope(), tvb, offset, attr_length));
break;
case XMCP_KEEPALIVE:
if (attr_length < 4)
@@ -770,7 +770,7 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
* a '<'), try XML.
* Otherwise, try plain-text.
*/
- test_string = tvb_get_ephemeral_string(next_tvb, 0, (attr_length < 32 ?
+ test_string = tvb_get_string(wmem_packet_scope(), next_tvb, 0, (attr_length < 32 ?
attr_length : 32));
tok = strtok(test_string, " \t\r\n");
if (tok && tok[0] == '<') {
diff --git a/epan/dissectors/packet-xml.c b/epan/dissectors/packet-xml.c
index f517270235..4e34e991d9 100644
--- a/epan/dissectors/packet-xml.c
+++ b/epan/dissectors/packet-xml.c
@@ -235,7 +235,7 @@ static gboolean dissect_xml_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
dissect_xml(tvb, pinfo, tree);
return TRUE;
} else if (pref_heuristic_unicode) {
- const guint8 *data_str = tvb_get_g_unicode_string(tvb, 0, tvb_length(tvb), ENC_LITTLE_ENDIAN);
+ const guint8 *data_str = tvb_get_unicode_string(NULL, tvb, 0, tvb_length(tvb), ENC_LITTLE_ENDIAN);
tvbuff_t *unicode_tvb = tvb_new_child_real_data(tvb, data_str, tvb_length(tvb)/2, tvb_length(tvb)/2);
tvb_set_free_cb(unicode_tvb, g_free);
if (tvbparse_peek(tvbparse_init(unicode_tvb, 0, -1, NULL, want_ignore), want_heur)) {
@@ -346,7 +346,7 @@ static void before_xmpli(void *tvbparse_data, const void *wanted_data _U_, tvbpa
proto_item *pi;
proto_tree *pt;
tvbparse_elem_t *name_tok = tok->sub->next;
- gchar *name = tvb_get_ephemeral_string(name_tok->tvb, name_tok->offset, name_tok->len);
+ gchar *name = tvb_get_string(wmem_packet_scope(), name_tok->tvb, name_tok->offset, name_tok->len);
xml_ns_t *ns = (xml_ns_t *)g_hash_table_lookup(xmpli_names, name);
xml_frame_t *new_frame;
@@ -418,8 +418,8 @@ static void before_tag(void *tvbparse_data, const void *wanted_data _U_, tvbpars
tvbparse_elem_t *leaf_tok = name_tok->sub->sub->next->next;
xml_ns_t *nameroot_ns;
- root_name = (gchar *)tvb_get_ephemeral_string(root_tok->tvb, root_tok->offset, root_tok->len);
- name = (gchar *)tvb_get_ephemeral_string(leaf_tok->tvb, leaf_tok->offset, leaf_tok->len);
+ root_name = (gchar *)tvb_get_string(wmem_packet_scope(), root_tok->tvb, root_tok->offset, root_tok->len);
+ name = (gchar *)tvb_get_string(wmem_packet_scope(), leaf_tok->tvb, leaf_tok->offset, leaf_tok->len);
name_orig_case = name;
nameroot_ns = (xml_ns_t *)g_hash_table_lookup(xml_ns.elements, root_name);
@@ -434,7 +434,7 @@ static void before_tag(void *tvbparse_data, const void *wanted_data _U_, tvbpars
}
} else {
- name = tvb_get_ephemeral_string(name_tok->tvb, name_tok->offset, name_tok->len);
+ name = tvb_get_string(wmem_packet_scope(), name_tok->tvb, name_tok->offset, name_tok->len);
name_orig_case = wmem_strdup(wmem_packet_scope(), name);
ascii_strdown_inplace(name);
@@ -528,7 +528,7 @@ static void before_dtd_doctype(void *tvbparse_data, const void *wanted_data _U_,
new_frame = (xml_frame_t *)wmem_alloc(wmem_packet_scope(), sizeof(xml_frame_t));
new_frame->type = XML_FRAME_DTD_DOCTYPE;
- new_frame->name = (gchar *)tvb_get_ephemeral_string(name_tok->tvb,
+ new_frame->name = (gchar *)tvb_get_string(wmem_packet_scope(), name_tok->tvb,
name_tok->offset,
name_tok->len);
new_frame->name_orig_case = new_frame->name;
@@ -587,7 +587,7 @@ static void after_attrib(void *tvbparse_data, const void *wanted_data _U_, tvbpa
proto_item *pi;
xml_frame_t *new_frame;
- name = tvb_get_ephemeral_string(tok->sub->tvb, tok->sub->offset, tok->sub->len);
+ name = tvb_get_string(wmem_packet_scope(), tok->sub->tvb, tok->sub->offset, tok->sub->len);
name_orig_case = wmem_strdup(wmem_packet_scope(), name);
ascii_strdown_inplace(name);
diff --git a/epan/dissectors/packet-xmpp-utils.c b/epan/dissectors/packet-xmpp-utils.c
index 3290184343..564d21489c 100644
--- a/epan/dissectors/packet-xmpp-utils.c
+++ b/epan/dissectors/packet-xmpp-utils.c
@@ -553,7 +553,7 @@ xmpp_xml_frame_to_element_t(xml_frame_t *xml_frame, xmpp_element_t *parent, tvbu
if((elem = tvbparse_get(tt,want_stream_end_with_ns))!=NULL)
{
- node->default_ns_abbrev = tvb_get_ephemeral_string(elem->sub->tvb, elem->sub->offset, elem->sub->len);
+ node->default_ns_abbrev = tvb_get_string(wmem_packet_scope(), elem->sub->tvb, elem->sub->offset, elem->sub->len);
}
child = xml_frame->first_child;
@@ -729,7 +729,7 @@ xmpp_element_to_string(tvbuff_t *tvb, xmpp_element_t *element)
if(tvb_offset_exists(tvb, element->offset+element->length-1))
{
- buff = tvb_get_ephemeral_string(tvb, element->offset, element->length);
+ buff = tvb_get_string(wmem_packet_scope(), tvb, element->offset, element->length);
}
return buff;
}
@@ -741,7 +741,7 @@ xmpp_attr_to_string(tvbuff_t *tvb, xmpp_attr_t *attr)
if(tvb_offset_exists(tvb, attr->offset + attr->length-1))
{
- buff = tvb_get_ephemeral_string(tvb, attr->offset, attr->length);
+ buff = tvb_get_string(wmem_packet_scope(), tvb, attr->offset, attr->length);
}
return buff;
}
diff --git a/epan/dissectors/packet-xtp.c b/epan/dissectors/packet-xtp.c
index 1d05b76133..388ed9ed0b 100644
--- a/epan/dissectors/packet-xtp.c
+++ b/epan/dissectors/packet-xtp.c
@@ -878,7 +878,7 @@ dissect_xtp_diag(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
offset += 4;
/* message(n) */
msg_len = tvb_length_remaining(tvb, offset);
- diag->msg = tvb_get_g_string(tvb, offset, msg_len);
+ diag->msg = tvb_get_string(NULL, tvb, offset, msg_len);
/** display **/
offset = start;
diff --git a/epan/dissectors/packet-yami.c b/epan/dissectors/packet-yami.c
index 347381fdb0..02f7294cc8 100644
--- a/epan/dissectors/packet-yami.c
+++ b/epan/dissectors/packet-yami.c
@@ -158,7 +158,7 @@ dissect_yami_parameter(tvbuff_t *tvb, proto_tree *tree, int offset, proto_item *
name_len = tvb_get_letohl(tvb, offset);
offset += 4;
- name = tvb_get_ephemeral_string_enc(tvb, offset, name_len, ENC_ASCII | ENC_NA);
+ name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, name_len, ENC_ASCII | ENC_NA);
proto_item_append_text(ti, ": %s", name);
proto_item_append_text(par_ti, "%s, ", name);
offset += (name_len + 3) & ~3;
@@ -214,7 +214,7 @@ dissect_yami_parameter(tvbuff_t *tvb, proto_tree *tree, int offset, proto_item *
val_len = tvb_get_letohl(tvb, offset);
offset += 4;
- val = tvb_get_ephemeral_string_enc(tvb, offset, val_len, ENC_ASCII | ENC_NA);
+ val = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, val_len, ENC_ASCII | ENC_NA);
proto_item_append_text(ti, ", Type: string, Value: \"%s\"", val);
offset += (val_len + 3) & ~3;
@@ -366,7 +366,7 @@ dissect_yami_parameter(tvbuff_t *tvb, proto_tree *tree, int offset, proto_item *
val_len = tvb_get_letohl(tvb, offset);
offset += 4;
- val = tvb_get_ephemeral_string_enc(tvb, offset, val_len, ENC_ASCII | ENC_NA);
+ val = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, val_len, ENC_ASCII | ENC_NA);
proto_item_append_text(ti, "\"%s\", ", val);
proto_tree_add_string(yami_param, &hfi_yami_param_value_str, tvb, val_offset, offset - val_offset, val);
diff --git a/epan/dissectors/packet-zbee-security.c b/epan/dissectors/packet-zbee-security.c
index 340c5ee91d..cd0c6e665b 100644
--- a/epan/dissectors/packet-zbee-security.c
+++ b/epan/dissectors/packet-zbee-security.c
@@ -473,15 +473,15 @@ dissect_zbee_secure(tvbuff_t *tvb, packet_info *pinfo, proto_tree* tree, guint o
* Eww, I think I just threw up a little... ZigBee requires this field
* to be patched before computing the MIC, but we don't have write-access
* to the tvbuff. So we need to allocate a copy of the whole thing just
- * so we can fix these 3 bits. Memory allocated by ep_tvb_memdup() is
- * automatically freed before the next packet is processed.
+ * so we can fix these 3 bits. Memory allocated by tvb_memdup(wmem_packet_scope(),...)
+ * is automatically freed before the next packet is processed.
*/
#ifdef HAVE_LIBGCRYPT
- enc_buffer = (guint8 *)ep_tvb_memdup(tvb, 0, tvb_length(tvb));
+ enc_buffer = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 0, tvb_length(tvb));
/*
* Override the const qualifiers and patch the security level field, we
* know it is safe to overide the const qualifiers because we just
- * allocated this memory via ep_tvb_memdup().
+ * allocated this memory via tvb_memdup(wmem_packet_scope(),...).
*/
enc_buffer[offset] = packet.control;
#endif /* HAVE_LIBGCRYPT */
diff --git a/epan/dissectors/packet-zbee-zcl-se.c b/epan/dissectors/packet-zbee-zcl-se.c
index 855ae70ac7..ba2b5ac1de 100644
--- a/epan/dissectors/packet-zbee-zcl-se.c
+++ b/epan/dissectors/packet-zbee-zcl-se.c
@@ -284,7 +284,7 @@ dissect_zcl_msg_display(tvbuff_t *tvb, proto_tree *tree, guint *offset)
*offset += 1;
/* Retrieve "Message" field */
- msg_data = tvb_get_ephemeral_string_enc(tvb, *offset, msg_len, ENC_LITTLE_ENDIAN);
+ msg_data = tvb_get_string_enc(wmem_packet_scope(), tvb, *offset, msg_len, ENC_LITTLE_ENDIAN);
proto_tree_add_string(tree, hf_zbee_zcl_msg_message, tvb, *offset, msg_len, msg_data);
*offset += msg_len;
diff --git a/epan/dissectors/packet-zbee-zcl.c b/epan/dissectors/packet-zbee-zcl.c
index a64e8950c8..91f52482f7 100644
--- a/epan/dissectors/packet-zbee-zcl.c
+++ b/epan/dissectors/packet-zbee-zcl.c
@@ -1767,7 +1767,7 @@ void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint
*offset += (int)1;
- attr_string = tvb_get_ephemeral_string(tvb, *offset, attr_uint);
+ attr_string = tvb_get_string(wmem_packet_scope(), tvb, *offset, attr_uint);
proto_item_append_text(tree, ", String: %s", attr_string);
proto_tree_add_string(tree, hf_zbee_zcl_attr_str, tvb, *offset, attr_uint, attr_string);
@@ -1801,7 +1801,7 @@ void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint
*offset += (int)2;
- attr_string = tvb_get_ephemeral_string(tvb, *offset, attr_uint);
+ attr_string = tvb_get_string(wmem_packet_scope(), tvb, *offset, attr_uint);
proto_item_append_text(tree, ", String: %s", attr_string);
proto_tree_add_string(tree, hf_zbee_zcl_attr_str, tvb, *offset, attr_uint, attr_string);
diff --git a/epan/dissectors/packet-zbee-zdp-discovery.c b/epan/dissectors/packet-zbee-zdp-discovery.c
index f3fcee0295..f743637b5e 100644
--- a/epan/dissectors/packet-zbee-zdp-discovery.c
+++ b/epan/dissectors/packet-zbee-zdp-discovery.c
@@ -1149,7 +1149,7 @@ dissect_zbee_zdp_rsp_user_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
}
else user_length = 0;
- user = tvb_get_ephemeral_string(tvb, offset, user_length);
+ user = tvb_get_string(wmem_packet_scope(), tvb, offset, user_length);
if (tree) {
proto_tree_add_string(tree, hf_zbee_zdp_user, tvb, offset, user_length, user);
}
diff --git a/epan/dissectors/packet-zep.c b/epan/dissectors/packet-zep.c
index 0c61dc7d86..4035b27e39 100644
--- a/epan/dissectors/packet-zep.c
+++ b/epan/dissectors/packet-zep.c
@@ -114,7 +114,7 @@ static void dissect_zep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissector_handle_t next_dissector;
/* Determine whether this is a Q51/IEEE 802.15.4 sniffer packet or not */
- if(strcmp(tvb_get_ephemeral_string(tvb, 0, 2), ZEP_PREAMBLE)){
+ if(strcmp(tvb_get_string(wmem_packet_scope(), tvb, 0, 2), ZEP_PREAMBLE)){
/* This is not a Q51/ZigBee sniffer packet */
call_dissector(data_handle, tvb, pinfo, tree);
return;
diff --git a/epan/dissectors/pidl/eventlog.cnf b/epan/dissectors/pidl/eventlog.cnf
index 225459b7d4..f60d4ed678 100644
--- a/epan/dissectors/pidl/eventlog.cnf
+++ b/epan/dissectors/pidl/eventlog.cnf
@@ -134,7 +134,7 @@ eventlog_dissect_element_Record_source_name(tvbuff_t *tvb, int offset, packet_in
int len;
len=eventlog_get_unicode_string_length(tvb, offset);
- str=tvb_get_ephemeral_faked_unicode(tvb, offset, len, TRUE);
+ str=tvb_get_faked_unicode(wmem_packet_scope(), tvb, offset, len, TRUE);
proto_tree_add_string_format(tree, hf_eventlog_Record_source_name, tvb, offset, len*2, str, "source_name: %s", str);
offset+=len*2;
@@ -148,7 +148,7 @@ eventlog_dissect_element_Record_computer_name(tvbuff_t *tvb, int offset, packet_
int len;
len=eventlog_get_unicode_string_length(tvb, offset);
- str=tvb_get_ephemeral_faked_unicode(tvb, offset, len, TRUE);
+ str=tvb_get_faked_unicode(wmem_packet_scope(), tvb, offset, len, TRUE);
proto_tree_add_string_format(tree, hf_eventlog_Record_computer_name, tvb, offset, len*2, str, "computer_name: %s", str);
offset+=len*2;
@@ -185,7 +185,7 @@ eventlog_dissect_element_Record_strings(tvbuff_t *tvb, int offset, packet_info *
int len;
len=eventlog_get_unicode_string_length(tvb, string_offset);
- str=tvb_get_ephemeral_faked_unicode(tvb, string_offset, len, TRUE);
+ str=tvb_get_faked_unicode(wmem_packet_scope(), tvb, string_offset, len, TRUE);
proto_tree_add_string_format(tree, hf_eventlog_Record_string, tvb, string_offset, len*2, str, "string: %s", str);
string_offset+=len*2;
diff --git a/epan/proto.c b/epan/proto.c
index 3975584853..f46431c28f 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -1471,7 +1471,10 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree,
*/
if (length == -1) {
/* This can throw an exception */
- string = tvb_get_g_stringz_enc(tvb, start, &length, encoding);
+
+
+
+ string = tvb_get_ephemeral_stringz_enc(tvb, start, &length, encoding);
} else if (length == 0) {
string = "[Empty]";
} else {
@@ -1506,7 +1509,7 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree,
* we made string values counted
* rather than null-terminated.)
*/
- string = tvb_get_ephemeral_string_enc(tvb, start, length, encoding);
+ string = tvb_get_string_enc(wmem_packet_scope(), tvb, start, length, encoding);
}
new_fi->length = length;
proto_tree_set_string(new_fi, string);
@@ -2466,7 +2469,7 @@ proto_tree_set_uint64_tvb(field_info *fi, tvbuff_t *tvb, gint start,
guint length, const guint encoding)
{
guint64 value = 0;
- guint8* b = (guint8 *)ep_tvb_memdup(tvb, start, length);
+ guint8* b = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, start, length);
if (encoding) {
b += length;
@@ -2632,7 +2635,7 @@ proto_tree_set_string_tvb(field_info *fi, tvbuff_t *tvb, gint start, gint length
length = tvb_ensure_length_remaining(tvb, start);
}
- string = tvb_get_ephemeral_string_enc(tvb, start, length, encoding);
+ string = tvb_get_string_enc(wmem_packet_scope(), tvb, start, length, encoding);
proto_tree_set_string(fi, string);
}
diff --git a/epan/req_resp_hdrs.c b/epan/req_resp_hdrs.c
index 81f9167da2..808daa7840 100644
--- a/epan/req_resp_hdrs.c
+++ b/epan/req_resp_hdrs.c
@@ -161,7 +161,7 @@ req_resp_hdrs_do_reassembly(tvbuff_t *tvb, const int offset, packet_info *pinfo,
/*
* Check if we've found Content-Length.
*/
- line = tvb_get_ephemeral_string(tvb, next_offset_sav, linelen);
+ line = tvb_get_string(wmem_packet_scope(), tvb, next_offset_sav, linelen);
if (g_ascii_strncasecmp(line, "Content-Length:", 15) == 0) {
/* XXX - what if it doesn't fit in an int?
(Do not "fix" that by making this
@@ -273,7 +273,7 @@ req_resp_hdrs_do_reassembly(tvbuff_t *tvb, const int offset, packet_info *pinfo,
}
/* We have a line with the chunk size in it.*/
- chunk_string = tvb_get_ephemeral_string(tvb, next_offset,
+ chunk_string = tvb_get_string(wmem_packet_scope(), tvb, next_offset,
linelen);
c = chunk_string;
@@ -348,7 +348,7 @@ req_resp_hdrs_do_reassembly(tvbuff_t *tvb, const int offset, packet_info *pinfo,
return TRUE;
}
/* Following sizeof will return the length of the string + \0 we need to not count it*/
- tmp = tvb_get_ephemeral_string(tvb, 0, sizeof("RPC_OUT_DATA") - 1);
+ tmp = tvb_get_string(wmem_packet_scope(), tvb, 0, sizeof("RPC_OUT_DATA") - 1);
if ((strncmp(tmp, "RPC_IN_DATA", sizeof("RPC_IN_DATA") - 1) == 0) ||
(strncmp(tmp, "RPC_OUT_DATA", sizeof("RPC_OUT_DATA") - 1) == 0)) {
return TRUE;
diff --git a/epan/tpg.h b/epan/tpg.h
index 0da6ca7108..f71feef35f 100644
--- a/epan/tpg.h
+++ b/epan/tpg.h
@@ -55,10 +55,10 @@ extern tpg_parser_data_t* tpg_start(proto_tree* root_tree,
#define TPG_TREE(vp) (((tpg_parser_data_t*)(vp))->tree)
#define TPG_DATA(vp,type) (((type*)(((tpg_parser_data_t*)(vp))->private_data)))
-#define TPG_STRING(i) tvb_get_ephemeral_string((i)->tvb,(i)->offset,(i)->len)
-#define TPG_INT(i) strtol(tvb_get_ephemeral_string((i)->tvb,(i)->offset,(i)->len),NULL,10)
-#define TPG_UINT(i) strtoul(tvb_get_ephemeral_string((i)->tvb,(i)->offset,(i)->len),NULL,10)
-#define TPG_UINT_HEX(i) strtoul(tvb_get_ephemeral_string((i)->tvb,(i)->offset,(i)->len),NULL,16)
+#define TPG_STRING(i) tvb_get_string(wmem_packet_scope(), (i)->tvb,(i)->offset,(i)->len)
+#define TPG_INT(i) strtol(tvb_get_string(wmem_packet_scope(), (i)->tvb,(i)->offset,(i)->len),NULL,10)
+#define TPG_UINT(i) strtoul(tvb_get_string(wmem_packet_scope(), (i)->tvb,(i)->offset,(i)->len),NULL,10)
+#define TPG_UINT_HEX(i) strtoul(tvb_get_string(wmem_packet_scope(), (i)->tvb,(i)->offset,(i)->len),NULL,16)
#define TPG_TVB(i) tvb_new_subset((i)->tvb,(i)->offset,(i)->len,(i)->len)
WS_DLL_PUBLIC guint32 tpg_ipv4(tvbparse_elem_t*);
diff --git a/epan/tvbparse.c b/epan/tvbparse.c
index dd7b94cd7b..64e8a38837 100644
--- a/epan/tvbparse.c
+++ b/epan/tvbparse.c
@@ -515,7 +515,7 @@ static int cond_hash(tvbparse_t* tt, const int offset, const tvbparse_wanted_t*
if (key_len < 0)
return -1;
- key = tvb_get_ephemeral_string(key_elem->tvb,key_elem->offset,key_elem->len);
+ key = tvb_get_string(wmem_packet_scope(),key_elem->tvb,key_elem->offset,key_elem->len);
#ifdef TVBPARSE_DEBUG
if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_HASH) g_warning("cond_hash: got key='%s'",key);
#endif
diff --git a/epan/tvbtest.c b/epan/tvbtest.c
index 64c58d2f98..63c3cd638b 100644
--- a/epan/tvbtest.c
+++ b/epan/tvbtest.c
@@ -252,10 +252,10 @@ test(tvbuff_t *tvb, gchar* name,
}
/* Sweep across data in various sized increments checking
- * tvb_g_memdup() */
+ * tvb_memdup() */
for (incr = 1; incr < length; incr++) {
for (i = 0; i < length - incr; i += incr) {
- ptr = tvb_g_memdup(tvb, i, incr);
+ ptr = tvb_memdup(NULL, tvb, i, incr);
if (memcmp(ptr, &expected_data[i], incr) != 0) {
printf("11: Failed TVB=%s Offset=%d Length=%d "
"Bad memdup\n",
@@ -269,7 +269,7 @@ test(tvbuff_t *tvb, gchar* name,
}
/* One big memdup */
- ptr = tvb_g_memdup(tvb, 0, -1);
+ ptr = tvb_memdup(NULL, tvb, 0, -1);
if (memcmp(ptr, expected_data, length) != 0) {
printf("12: Failed TVB=%s Offset=0 Length=-1 "
"Bad memdup\n", name);
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index 23d0ed933f..4bc6a400d1 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -756,39 +756,14 @@ tvb_memcpy(tvbuff_t *tvb, void *target, const gint offset, size_t length)
* "composite_get_ptr()" depends on -1 not being
* an error; does anything else depend on this routine treating -1 as
* meaning "to the end of the buffer"?
- */
-void *
-tvb_g_memdup(tvbuff_t *tvb, const gint offset, size_t length)
-{
- guint abs_offset, abs_length;
- void *duped;
-
- DISSECTOR_ASSERT(tvb && tvb->initialized);
-
- check_offset_length(tvb, offset, (gint) length, &abs_offset, &abs_length);
-
- duped = g_malloc(abs_length);
- return tvb_memcpy(tvb, duped, abs_offset, abs_length);
-}
-
-/*
- * XXX - this doesn't treat a length of -1 as an error.
- * If it did, this could replace some code that calls
- * "tvb_ensure_bytes_exist()" and then allocates a buffer and copies
- * data to it.
- *
- * "composite_get_ptr()" depends on -1 not being
- * an error; does anything else depend on this routine treating -1 as
- * meaning "to the end of the buffer"?
*
- * This function allocates memory from a buffer with packet lifetime.
- * You do not have to free this buffer, it will be automatically freed
- * when wireshark starts decoding the next packet.
- * Do not use this function if you want the allocated memory to be persistent
- * after the current packet has been dissected.
+ * If scope is NULL, memory is allocated with g_malloc() and user must
+ * explicitely free it with g_free().
+ * If scope is not NULL, memory is allocated with the corresponding pool
+ * lifetime.
*/
void *
-ep_tvb_memdup(tvbuff_t *tvb, const gint offset, size_t length)
+tvb_memdup(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, size_t length)
{
guint abs_offset, abs_length;
void *duped;
@@ -797,7 +772,7 @@ ep_tvb_memdup(tvbuff_t *tvb, const gint offset, size_t length)
check_offset_length(tvb, offset, (gint) length, &abs_offset, &abs_length);
- duped = ep_alloc(abs_length);
+ duped = wmem_alloc(scope, abs_length);
return tvb_memcpy(tvb, duped, abs_offset, abs_length);
}
@@ -1369,7 +1344,7 @@ tvb_get_bits_buf(tvbuff_t *tvb, guint bit_offset, gint no_of_bits, guint8 *buf,
}
guint8 *
-ep_tvb_get_bits(tvbuff_t *tvb, guint bit_offset, gint no_of_bits, gboolean lsb0)
+wmem_packet_tvb_get_bits(tvbuff_t *tvb, guint bit_offset, gint no_of_bits, gboolean lsb0)
{
gint no_of_bytes;
guint8 *buf;
@@ -1381,7 +1356,7 @@ ep_tvb_get_bits(tvbuff_t *tvb, guint bit_offset, gint no_of_bits, gboolean lsb0)
}
no_of_bytes = (no_of_bits >> 3) + ((no_of_bits & 0x7) != 0); /* ceil(no_of_bits / 8.0) */
- buf = (guint8 *)ep_alloc(no_of_bytes);
+ buf = (guint8 *)wmem_alloc(wmem_packet_scope(), no_of_bytes);
tvb_get_bits_buf(tvb, bit_offset, no_of_bits, buf, lsb0);
return buf;
}
@@ -1798,48 +1773,17 @@ tvb_memeql(tvbuff_t *tvb, const gint offset, const guint8 *str, size_t size)
}
/* Convert a string from Unicode to ASCII. At the moment we fake it by
- * replacing all non-ASCII characters with a '.' )-: The caller must
- * free the result returned. The len parameter is the number of guint16's
- * to convert from Unicode. */
-/* XXX - this function has been superceded by tvb_get_unicode_string() */
-char *
-tvb_fake_unicode(tvbuff_t *tvb, int offset, const int len, const gboolean little_endian)
-{
- char *buffer;
- int i;
- guint16 character;
-
- /* Make sure we have enough data before allocating the buffer,
- so we don't blow up if the length is huge. */
- tvb_ensure_bytes_exist(tvb, offset, 2*len);
-
- /* We know we won't throw an exception, so we don't have to worry
- about leaking this buffer. */
- buffer = (char *)g_malloc(len + 1);
-
- for (i = 0; i < len; i++) {
- character = little_endian ? tvb_get_letohs(tvb, offset)
- : tvb_get_ntohs(tvb, offset);
- buffer[i] = character < 256 ? character : '.';
- offset += 2;
- }
-
- buffer[len] = 0;
-
- return buffer;
-}
-
-/* Convert a string from Unicode to ASCII. At the moment we fake it by
* replacing all non-ASCII characters with a '.' )-: The len parameter is
* the number of guint16's to convert from Unicode.
*
- * This function allocates memory from a buffer with packet lifetime.
- * You do not have to free this buffer, it will be automatically freed
- * when wireshark starts decoding the next packet.
+ * If scope is set to NULL, returned buffer is allocated by g_malloc()
+ * and must be g_free by the caller. Otherwise memory is automatically
+ * freed when the scope lifetime is reached.
*/
-/* XXX: This has been replaced by tvb_get_ephemeral_unicode_string() */
+/* XXX: This has been replaced by tvb_get_string() */
char *
-tvb_get_ephemeral_faked_unicode(tvbuff_t *tvb, int offset, const int len, const gboolean little_endian)
+tvb_get_faked_unicode(wmem_allocator_t *scope, tvbuff_t *tvb, int offset,
+ const int len, const gboolean little_endian)
{
char *buffer;
int i;
@@ -1851,7 +1795,7 @@ tvb_get_ephemeral_faked_unicode(tvbuff_t *tvb, int offset, const int len, const
/* We know we won't throw an exception, so we don't have to worry
about leaking this buffer. */
- buffer = (char *)ep_alloc(len + 1);
+ buffer = (char *)wmem_alloc(scope, len + 1);
for (i = 0; i < len; i++) {
character = little_endian ? tvb_get_letohs(tvb, offset)
@@ -1960,22 +1904,20 @@ tvb_format_stringzpad_wsp(tvbuff_t *tvb, const gint offset, const gint size)
* to hold a non-null-terminated string of that length at that offset,
* plus a trailing '\0', copy the string into it, and return a pointer
* to the string.
- *
+ * If scope is NULL, memory is allocated with g_malloc() and user must
+ * explicitely free it with g_free().
+ * If scope is not NULL, memory is allocated with the corresponding pool
+ * lifetime.
* Throws an exception if the tvbuff ends before the string does.
*/
guint8 *
-tvb_get_g_string(tvbuff_t *tvb, const gint offset, const gint length)
+tvb_get_string(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, const gint length)
{
- const guint8 *ptr;
- guint8 *strbuf = NULL;
-
- tvb_ensure_bytes_exist(tvb, offset, length);
+ guint8 *strbuf;
- ptr = ensure_contiguous(tvb, offset, length);
- strbuf = (guint8 *)g_malloc(length + 1);
- if (length != 0) {
- memcpy(strbuf, ptr, length);
- }
+ tvb_ensure_bytes_exist(tvb, offset, length); /* make sure length = -1 fails */
+ strbuf = (guint8 *)wmem_alloc(scope, length + 1);
+ tvb_memcpy(tvb, strbuf, offset, length);
strbuf[length] = '\0';
return strbuf;
}
@@ -1988,30 +1930,34 @@ tvb_get_g_string(tvbuff_t *tvb, const gint offset, const gint length)
*
* Specify length in bytes
*
- * Returns an UTF-8 string that must be freed by the caller
+ * If scope is NULL, memory is allocated with g_malloc() and user must
+ * explicitely free it with g_free().
+ * If scope is not NULL, memory is allocated with the corresponding pool
+ * lifetime.
+ *
+ * Returns an UTF-8 string
*/
gchar *
-tvb_get_g_unicode_string(tvbuff_t *tvb, const gint offset, gint length, const guint encoding)
+tvb_get_unicode_string(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, gint length, const guint encoding)
{
- gunichar2 uchar;
- gint i; /* Byte counter for tvbuff */
- GString *strbuf = NULL;
+ gunichar2 uchar;
+ gint i; /* Byte counter for tvbuff */
+ wmem_strbuf_t *strbuf;
tvb_ensure_bytes_exist(tvb, offset, length);
- strbuf = g_string_new(NULL);
+ strbuf = wmem_strbuf_new(scope, NULL);
for(i = 0; i < length; i += 2) {
-
if (encoding == ENC_BIG_ENDIAN)
uchar = tvb_get_ntohs(tvb, offset + i);
else
uchar = tvb_get_letohs(tvb, offset + i);
- g_string_append_unichar(strbuf, uchar);
+ wmem_strbuf_append_unichar(strbuf, uchar);
}
- return g_string_free(strbuf, FALSE);
+ return (gchar*)wmem_strbuf_get_str(strbuf);
}
/*
@@ -2023,14 +1969,13 @@ tvb_get_g_unicode_string(tvbuff_t *tvb, const gint offset, gint length, const gu
*
* Throws an exception if the tvbuff ends before the string does.
*
- * This function allocates memory from a buffer with packet lifetime.
- * You do not have to free this buffer, it will be automatically freed
- * when wireshark starts decoding the next packet.
- * Do not use this function if you want the allocated memory to be persistent
- * after the current packet has been dissected.
+ * If scope is NULL, memory is allocated with g_malloc() and user must
+ * explicitely free it with g_free().
+ * If scope is not NULL, memory is allocated with the corresponding pool
+ * lifetime.
*/
guint8 *
-tvb_get_ephemeral_string_enc(tvbuff_t *tvb, const gint offset,
+tvb_get_string_enc(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset,
const gint length, const guint encoding)
{
const guint8 *ptr;
@@ -2052,7 +1997,7 @@ tvb_get_ephemeral_string_enc(tvbuff_t *tvb, const gint offset,
* XXX - should map all octets with the 8th bit
* not set to a "substitute" UTF-8 character.
*/
- strbuf = tvb_get_ephemeral_string(tvb, offset, length);
+ strbuf = tvb_get_string(scope, tvb, offset, length);
break;
case ENC_UTF_8:
@@ -2060,7 +2005,7 @@ tvb_get_ephemeral_string_enc(tvbuff_t *tvb, const gint offset,
* XXX - should map all invalid UTF-8 sequences
* to a "substitute" UTF-8 character.
*/
- strbuf = tvb_get_ephemeral_string(tvb, offset, length);
+ strbuf = tvb_get_string(scope, tvb, offset, length);
break;
case ENC_UTF_16:
@@ -2069,7 +2014,7 @@ tvb_get_ephemeral_string_enc(tvbuff_t *tvb, const gint offset,
* invalid characters and sequences to a "substitute"
* UTF-8 character.
*/
- strbuf = tvb_get_ephemeral_unicode_string(tvb, offset, length,
+ strbuf = tvb_get_unicode_string(scope, tvb, offset, length,
encoding & ENC_LITTLE_ENDIAN);
break;
@@ -2080,7 +2025,7 @@ tvb_get_ephemeral_string_enc(tvbuff_t *tvb, const gint offset,
* components of a UTF-16 surrogate pair) to a
* "substitute" UTF-8 character.
*/
- strbuf = tvb_get_ephemeral_unicode_string(tvb, offset, length,
+ strbuf = tvb_get_unicode_string(scope, tvb, offset, length,
encoding & ENC_LITTLE_ENDIAN);
break;
@@ -2091,7 +2036,7 @@ tvb_get_ephemeral_string_enc(tvbuff_t *tvb, const gint offset,
* XXX - multiple "dialects" of EBCDIC?
*/
tvb_ensure_bytes_exist(tvb, offset, length); /* make sure length = -1 fails */
- strbuf = (guint8 *)ep_alloc(length + 1);
+ strbuf = (guint8 *)wmem_alloc(scope, length + 1);
if (length != 0) {
ptr = ensure_contiguous(tvb, offset, length);
memcpy(strbuf, ptr, length);
@@ -2103,80 +2048,6 @@ tvb_get_ephemeral_string_enc(tvbuff_t *tvb, const gint offset,
return strbuf;
}
-guint8 *
-tvb_get_ephemeral_string(tvbuff_t *tvb, const gint offset, const gint length)
-{
- guint8 *strbuf;
-
- tvb_ensure_bytes_exist(tvb, offset, length); /* make sure length = -1 fails */
- strbuf = (guint8 *)ep_alloc(length + 1);
- tvb_memcpy(tvb, strbuf, offset, length);
- strbuf[length] = '\0';
- return strbuf;
-}
-
-/*
- * Unicode (UTF-16) version of tvb_get_ephemeral_string()
- * XXX - this is UCS-2, not UTF-16, as it doesn't handle surrogate pairs
- *
- * Encoding parameter should be ENC_BIG_ENDIAN or ENC_LITTLE_ENDIAN
- *
- * Specify length in bytes
- *
- * Returns an ep_ allocated UTF-8 string
- */
-gchar *
-tvb_get_ephemeral_unicode_string(tvbuff_t *tvb, const gint offset, gint length, const guint encoding)
-{
- gunichar2 uchar;
- gint i; /* Byte counter for tvbuff */
- emem_strbuf_t *strbuf;
-
- tvb_ensure_bytes_exist(tvb, offset, length);
-
- strbuf = ep_strbuf_new(NULL);
-
- for(i = 0; i < length; i += 2) {
- if (encoding == ENC_BIG_ENDIAN)
- uchar = tvb_get_ntohs(tvb, offset + i);
- else
- uchar = tvb_get_letohs(tvb, offset + i);
-
- ep_strbuf_append_unichar(strbuf, uchar);
- }
-
- return strbuf->str;
-}
-
-/*
- * Given a tvbuff, an offset, and a length, allocate a buffer big enough
- * to hold a non-null-terminated string of that length at that offset,
- * plus a trailing '\0', copy the string into it, and return a pointer
- * to the string.
- *
- * Throws an exception if the tvbuff ends before the string does.
- *
- * This function allocates memory from a buffer with capture session lifetime.
- * You do not have to free this buffer, it will be automatically freed
- * when wireshark starts or opens a new capture.
- */
-guint8 *
-tvb_get_seasonal_string(tvbuff_t *tvb, const gint offset, const gint length)
-{
- const guint8 *ptr;
- guint8 *strbuf = NULL;
-
- tvb_ensure_bytes_exist(tvb, offset, length);
-
- ptr = ensure_contiguous(tvb, offset, length);
- strbuf = (guint8 *)se_alloc(length + 1);
- if (length != 0) {
- memcpy(strbuf, ptr, length);
- }
- strbuf[length] = '\0';
- return strbuf;
-}
-
/*
* Given a tvbuff, an offset, and an encoding, with the offset assumed
* to refer to a null-terminated string, find the length of that string
@@ -2990,7 +2861,7 @@ tvb_uncompress(tvbuff_t *tvb, const int offset, int comprlen)
return NULL;
}
- compr = (guint8 *)tvb_g_memdup(tvb, offset, comprlen);
+ compr = (guint8 *)tvb_memdup(NULL, tvb, offset, comprlen);
if (!compr)
return NULL;
diff --git a/epan/tvbuff.h b/epan/tvbuff.h
index 4bdfc5d8f5..90d2d10806 100644
--- a/epan/tvbuff.h
+++ b/epan/tvbuff.h
@@ -38,6 +38,7 @@
#include <glib.h>
#include <epan/ipv6-utils.h>
#include <epan/guid-utils.h>
+#include <epan/wmem/wmem.h>
#include "exceptions.h"
#ifdef __cplusplus
@@ -327,7 +328,7 @@ WS_DLL_PUBLIC guint32 tvb_get_bits(tvbuff_t *tvb, const guint bit_offset, const
WS_DLL_PUBLIC
void tvb_get_bits_buf(tvbuff_t *tvb, guint bit_offset, gint no_of_bits, guint8 *buf, gboolean lsb0);
WS_DLL_PUBLIC
-guint8 *ep_tvb_get_bits(tvbuff_t *tvb, guint bit_offset, gint no_of_bits, gboolean lsb0);
+guint8 *wmem_packet_tvb_get_bits(tvbuff_t *tvb, guint bit_offset, gint no_of_bits, gboolean lsb0);
/** Returns target for convenience. Does not suffer from possible
* expense of tvb_get_ptr(), since this routine is smart enough
@@ -337,15 +338,11 @@ guint8 *ep_tvb_get_bits(tvbuff_t *tvb, guint bit_offset, gint no_of_bits, gboole
* target memory. */
WS_DLL_PUBLIC void* tvb_memcpy(tvbuff_t*, void* target, const gint offset, size_t length);
-/** It is the user's responsibility to g_free() the memory allocated by
- * tvb_g_memdup(). Calls tvb_memcpy() */
-WS_DLL_PUBLIC void* tvb_g_memdup(tvbuff_t*, const gint offset, size_t length);
-
-/* Same as above but the buffer returned from this function does not have to
-* be freed. It will be automatically freed after the packet is dissected.
-* Buffers allocated by this function are NOT persistent.
-*/
-WS_DLL_PUBLIC void* ep_tvb_memdup(tvbuff_t *tvb, const gint offset, size_t length);
+/** If scope is set to NULL it is the user's responsibility to g_free()
+ * the memory allocated by tvb_memdup(). Otherwise memory is
+ * automatically freed when the scope lifetime is reached.
+ * Calls tvb_memcpy() */
+WS_DLL_PUBLIC void* tvb_memdup(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, size_t length);
/** WARNING! This function is possibly expensive, temporarily allocating
* another copy of the packet data. Furthermore, it's dangerous because once
@@ -419,19 +416,13 @@ WS_DLL_PUBLIC gint tvb_strnlen(tvbuff_t*, const gint offset, const guint maxleng
* of guint16's to convert from Unicode.
*
* XXX - These functions have been superceded by tvb_get_unicode_string()
- * and tvb_get_ephemeral_unicode_string()
- *
- * tvb_fake_unicode() returns a buffer allocated by g_malloc() and must
- * be g_free() by the caller.
- * tvb_get_ephemeral_faked_unicode() returns a buffer that does not need
- * to be explicitely freed. Instead this buffer is
- * automatically freed when wireshark starts dissecting
- * the next packet.
+ *
+ * If scope is set to NULL, returned buffer is allocated by g_malloc()
+ * and must be g_free by the caller. Otherwise memory is automatically
+ * freed when the scope lifetime is reached.
*/
-WS_DLL_PUBLIC char *tvb_fake_unicode(tvbuff_t *tvb, int offset, const int len,
- const gboolean little_endian);
-WS_DLL_PUBLIC char *tvb_get_ephemeral_faked_unicode(tvbuff_t *tvb, int offset, const int len,
- const gboolean little_endian);
+WS_DLL_PUBLIC char *tvb_get_faked_unicode(wmem_allocator_t *scope, tvbuff_t *tvb,
+ int offset, const int len, const gboolean little_endian);
/**
* Format the data in the tvb from offset for size ...
@@ -465,33 +456,22 @@ extern gchar *tvb_format_stringzpad_wsp(tvbuff_t *tvb, const gint offset, const
*
* Throws an exception if the tvbuff ends before the string does.
*
- * tvb_get_string() returns a string allocated by g_malloc() and therefore
- * MUST be g_free() by the caller in order not to leak
- * memory.
- *
- * tvb_get_unicode_string() Unicode (UTF-16) version of above
- *
- * tvb_get_ephemeral_string() returns a string that does not need to be freed,
- * instead it will automatically be freed once the next
- * packet is dissected.
+ * tvb_get_string() returns a string allocated.
*
- * tvb_get_ephemeral_string_enc() takes a string encoding as well, and
- * converts to UTF-8 from the encoding (only UTF-8 and
- * EBCDIC supported)
+ * tvb_get_unicode_string() Unicode (UTF-16) version of above.
*
- * tvb_get_ephemeral_unicode_string() Unicode (UTF-16) version of above
+ * tvb_get_string_enc() takes a string encoding as well, and converts to UTF-8
+ * from the encoding (only UTF-8 and EBCDIC supported).
*
- * tvb_get_seasonal_string() returns a string that does not need to be freed,
- * instead it will automatically be freed when a new capture
- * or file is opened.
+ * If scope is set to NULL it is the user's responsibility to g_free()
+ * the memory allocated by tvb_memdup(). Otherwise memory is
+ * automatically freed when the scope lifetime is reached.
*/
-WS_DLL_PUBLIC guint8 *tvb_get_g_string(tvbuff_t *tvb, const gint offset, const gint length);
-WS_DLL_PUBLIC gchar *tvb_get_g_unicode_string(tvbuff_t *tvb, const gint offset, gint length, const guint encoding);
-WS_DLL_PUBLIC guint8 *tvb_get_ephemeral_string(tvbuff_t *tvb, const gint offset, const gint length);
-WS_DLL_PUBLIC guint8 *tvb_get_ephemeral_string_enc(tvbuff_t *tvb, const gint offset,
+WS_DLL_PUBLIC guint8 *tvb_get_string(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, const gint length);
+WS_DLL_PUBLIC gchar *tvb_get_unicode_string(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, gint length,
+ const guint encoding);
+WS_DLL_PUBLIC guint8 *tvb_get_string_enc(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset,
const gint length, const guint encoding);
-extern gchar *tvb_get_ephemeral_unicode_string(tvbuff_t *tvb, const gint offset, gint length, const guint encoding);
-extern guint8 *tvb_get_seasonal_string(tvbuff_t *tvb, const gint offset, const gint length);
/**
diff --git a/epan/tvbuff_composite.c b/epan/tvbuff_composite.c
index 05032ddf80..e9be61e20b 100644
--- a/epan/tvbuff_composite.c
+++ b/epan/tvbuff_composite.c
@@ -116,7 +116,7 @@ composite_get_ptr(tvbuff_t *tvb, guint abs_offset, guint abs_length)
return tvb_get_ptr(member_tvb, member_offset, abs_length);
}
else {
- tvb->real_data = (guint8 *)tvb_g_memdup(tvb, 0, -1);
+ tvb->real_data = (guint8 *)tvb_memdup(NULL, tvb, 0, -1);
return tvb->real_data + abs_offset;
}
diff --git a/epan/wslua/wslua_dumper.c b/epan/wslua/wslua_dumper.c
index 6eea48d472..8c923988c2 100644
--- a/epan/wslua/wslua_dumper.c
+++ b/epan/wslua/wslua_dumper.c
@@ -414,7 +414,7 @@ WSLUA_METHOD Dumper_dump_current(lua_State* L) {
if (lua_pinfo->pkt_comment)
pkthdr.opt_comment = ep_strdup(lua_pinfo->pkt_comment);
- data = (const guchar *)ep_tvb_memdup(tvb,0,pkthdr.caplen);
+ data = (const guchar *)tvb_memdup(wmem_packet_scope(),tvb,0,pkthdr.caplen);
if (! wtap_dump(d, &pkthdr, data, &err)) {
luaL_error(L,"error while dumping: %s",
diff --git a/epan/wslua/wslua_field.c b/epan/wslua/wslua_field.c
index 8fa5f0cc3b..c4eb7e36e7 100644
--- a/epan/wslua/wslua_field.c
+++ b/epan/wslua/wslua_field.c
@@ -100,7 +100,7 @@ WSLUA_METAMETHOD FieldInfo__call(lua_State* L) {
Address eth = (Address)g_malloc(sizeof(address));
eth->type = AT_ETHER;
eth->len = fi->length;
- eth->data = tvb_g_memdup(fi->ds_tvb,fi->start,fi->length);
+ eth->data = tvb_memdup(NULL,fi->ds_tvb,fi->start,fi->length);
pushAddress(L,eth);
return 1;
}
@@ -108,7 +108,7 @@ WSLUA_METAMETHOD FieldInfo__call(lua_State* L) {
Address ipv4 = (Address)g_malloc(sizeof(address));
ipv4->type = AT_IPv4;
ipv4->len = fi->length;
- ipv4->data = tvb_g_memdup(fi->ds_tvb,fi->start,fi->length);
+ ipv4->data = tvb_memdup(NULL,fi->ds_tvb,fi->start,fi->length);
pushAddress(L,ipv4);
return 1;
}
@@ -116,7 +116,7 @@ WSLUA_METAMETHOD FieldInfo__call(lua_State* L) {
Address ipv6 = (Address)g_malloc(sizeof(address));
ipv6->type = AT_IPv6;
ipv6->len = fi->length;
- ipv6->data = tvb_g_memdup(fi->ds_tvb,fi->start,fi->length);
+ ipv6->data = tvb_memdup(NULL,fi->ds_tvb,fi->start,fi->length);
pushAddress(L,ipv6);
return 1;
}
@@ -124,7 +124,7 @@ WSLUA_METAMETHOD FieldInfo__call(lua_State* L) {
Address ipx = (Address)g_malloc(sizeof(address));
ipx->type = AT_IPX;
ipx->len = fi->length;
- ipx->data = tvb_g_memdup(fi->ds_tvb,fi->start,fi->length);
+ ipx->data = tvb_memdup(NULL,fi->ds_tvb,fi->start,fi->length);
pushAddress(L,ipx);
return 1;
}
@@ -157,7 +157,7 @@ WSLUA_METAMETHOD FieldInfo__call(lua_State* L) {
case FT_PROTOCOL:
case FT_OID: {
ByteArray ba = g_byte_array_new();
- g_byte_array_append(ba, (const guint8 *)ep_tvb_memdup(fi->ds_tvb,fi->start,fi->length),fi->length);
+ g_byte_array_append(ba, (const guint8 *)tvb_memdup(wmem_packet_scope(),fi->ds_tvb,fi->start,fi->length),fi->length);
pushByteArray(L,ba);
return 1;
}
diff --git a/epan/wslua/wslua_tvb.c b/epan/wslua/wslua_tvb.c
index 1d4b94c30e..b0cef305da 100644
--- a/epan/wslua/wslua_tvb.c
+++ b/epan/wslua/wslua_tvb.c
@@ -1024,7 +1024,7 @@ WSLUA_METHOD TvbRange_ether(lua_State* L) {
addr = g_new(address,1);
- buff = (guint8 *)tvb_g_memdup(tvbr->tvb->ws_tvb,tvbr->offset,tvbr->len);
+ buff = (guint8 *)tvb_memdup(NULL,tvbr->tvb->ws_tvb,tvbr->offset,tvbr->len);
SET_ADDRESS(addr, AT_ETHER, 6, buff);
pushAddress(L,addr);
@@ -1102,7 +1102,7 @@ WSLUA_METHOD TvbRange_string(lua_State* L) {
return 0;
}
- lua_pushlstring(L, (gchar*)tvb_get_ephemeral_string(tvbr->tvb->ws_tvb,tvbr->offset,tvbr->len), tvbr->len );
+ lua_pushlstring(L, (gchar*)tvb_get_string(wmem_packet_scope(),tvbr->tvb->ws_tvb,tvbr->offset,tvbr->len), tvbr->len );
WSLUA_RETURN(1); /* The string */
}
@@ -1118,7 +1118,7 @@ static int TvbRange_ustring_any(lua_State* L, gboolean little_endian) {
return 0;
}
- str = (gchar*)tvb_get_ephemeral_unicode_string(tvbr->tvb->ws_tvb,tvbr->offset,tvbr->len,(little_endian ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN));
+ str = (gchar*)tvb_get_unicode_string(wmem_packet_scope(),tvbr->tvb->ws_tvb,tvbr->offset,tvbr->len,(little_endian ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN));
lua_pushlstring(L, str, strlen(str));
return 1; /* The string */
@@ -1204,7 +1204,7 @@ WSLUA_METHOD TvbRange_bytes(lua_State* L) {
}
ba = g_byte_array_new();
- g_byte_array_append(ba,(const guint8 *)ep_tvb_memdup(tvbr->tvb->ws_tvb,tvbr->offset,tvbr->len),tvbr->len);
+ g_byte_array_append(ba,(const guint8 *)tvb_memdup(wmem_packet_scope(),tvbr->tvb->ws_tvb,tvbr->offset,tvbr->len),tvbr->len);
pushByteArray(L,ba);
diff --git a/plugins/irda/packet-irda.c b/plugins/irda/packet-irda.c
index 083bc499b3..2e4c8548a3 100644
--- a/plugins/irda/packet-irda.c
+++ b/plugins/irda/packet-irda.c
@@ -741,7 +741,7 @@ static void dissect_iap_result(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ro
case IAS_STRING:
n = tvb_get_guint8(tvb, offset + 8);
- string = tvb_get_ephemeral_string(tvb, offset + 9, n);
+ string = tvb_get_string(wmem_packet_scope(), tvb, offset + 9, n);
g_snprintf(buf, 300, ", \"%s\"", string);
break;
}
diff --git a/plugins/unistim/packet-unistim.c b/plugins/unistim/packet-unistim.c
index a333ecc51c..9c67106fd6 100644
--- a/plugins/unistim/packet-unistim.c
+++ b/plugins/unistim/packet-unistim.c
@@ -1069,7 +1069,7 @@ dissect_display_switch(proto_tree *msg_tree,
}
if(msg_len>0){
/* I'm guessing this will work flakily at best */
- uinfo->string_data = tvb_get_ephemeral_string(tvb,offset,msg_len);
+ uinfo->string_data = tvb_get_string(wmem_packet_scope(), tvb,offset,msg_len);
set_ascii_item(msg_tree,tvb,offset,msg_len);
}
diff --git a/plugins/wimaxasncp/packet-wimaxasncp.c b/plugins/wimaxasncp/packet-wimaxasncp.c
index e090ade775..6ea1c64d30 100644
--- a/plugins/wimaxasncp/packet-wimaxasncp.c
+++ b/plugins/wimaxasncp/packet-wimaxasncp.c
@@ -835,7 +835,7 @@ static void wimaxasncp_dissect_tlv_value(
if (tree)
{
const guint8 *p;
- const gchar *s = tvb_get_ephemeral_string(tvb, offset, length);
+ const gchar *s = tvb_get_string(wmem_packet_scope(), tvb, offset, length);
p = tvb_get_ptr(tvb, offset, length);