diff --git a/debian/libwireshark0.symbols b/debian/libwireshark0.symbols index 18e2efe198..43daa5b027 100644 --- a/debian/libwireshark0.symbols +++ b/debian/libwireshark0.symbols @@ -78,7 +78,6 @@ libwireshark.so.0 libwireshark0 #MINVER# bytes_to_ep_str@Base 1.12.0~rc1 bytes_to_ep_str_punct@Base 1.12.0~rc1 bytes_to_str@Base 1.99.2 - bytestring_to_ep_str@Base 1.12.0~rc1 bytestring_to_str@Base 1.9.1 call_ber_oid_callback@Base 1.9.1 call_dissector@Base 1.9.1 diff --git a/epan/address_to_str.c b/epan/address_to_str.c index 004e18a586..6d8f26d203 100644 --- a/epan/address_to_str.c +++ b/epan/address_to_str.c @@ -203,11 +203,11 @@ ipx_addr_to_str(const guint32 net, const guint8 *ad) name = get_ether_name_if_known(ad); if (name) { - buf = ep_strdup_printf("%s.%s", get_ipxnet_name(net), name); + buf = wmem_strdup_printf(wmem_packet_scope(), "%s.%s", get_ipxnet_name(net), name); } else { - buf = ep_strdup_printf("%s.%s", get_ipxnet_name(net), - bytestring_to_ep_str(ad, 6, '\0')); + buf = wmem_strdup_printf(wmem_packet_scope(), "%s.%s", get_ipxnet_name(net), + bytestring_to_str(wmem_packet_scope(), ad, 6, '\0')); } return buf; } diff --git a/epan/oids.c b/epan/oids.c index d1d270eee1..2e5ec06447 100644 --- a/epan/oids.c +++ b/epan/oids.c @@ -199,7 +199,9 @@ extern void oid_add_from_encoded(const char* name, const guint8 *oid, gint oid_l D(3,("\tOid (from encoded): %s %s ",name, oid_subid2string(subids,subids_len))); add_oid(name,OID_KIND_UNKNOWN,NULL,NULL,subids_len,subids); } else { - D(1,("Failed to add Oid: %s [%d]%s ",name?name:"NULL", oid_len,bytestring_to_ep_str(oid, oid_len, ':'))); + gchar* bytestr = (gchar*)bytestring_to_str(NULL, oid, oid_len, ':'); + D(1,("Failed to add Oid: %s [%d]%s ",name?name:"NULL", oid_len, bytestr)); + wmem_free(NULL, bytestr); } } @@ -1283,10 +1285,10 @@ char* oid_test_a2b(guint32 num_subids, guint32* subids) { "oid_string2encoded=[%d]%s \n" "oid_string2subid=%s \n " ,sub2str - ,sub2enc_len,bytestring_to_ep_str(sub2enc, sub2enc_len, ':') + ,sub2enc_len,bytestring_to_str(wmem_packet_scope(), sub2enc, sub2enc_len, ':') ,enc2sub ? oid_subid2string(enc2sub,enc2sub_len) : "-" ,enc2str - ,str2enc_len,bytestring_to_ep_str(str2enc, str2enc_len, ':') + ,str2enc_len,bytestring_to_str(wmem_packet_scope(), str2enc, str2enc_len, ':') ,str2sub ? oid_subid2string(str2sub,str2sub_len) : "-" ); } diff --git a/epan/to_str.c b/epan/to_str.c index 20e965a717..4b77ddc2f8 100644 --- a/epan/to_str.c +++ b/epan/to_str.c @@ -162,38 +162,6 @@ bytes_to_hexstr_punct(char *out, const guint8 *ad, guint32 len, char punct) * If punct is '\0', no punctuation is applied (and thus * the resulting string is (len-1) bytes shorter) */ -const gchar * -bytestring_to_ep_str(const guint8 *ad, const guint32 len, const char punct) -{ - gchar *buf; - size_t buflen; - - if (!ad) - REPORT_DISSECTOR_BUG("Null pointer passed to bytestring_to_ep_str()"); - - /* XXX, Old code was using int as iterator... Why len is guint32 anyway?! (darkjames) */ - if ( ((int) len) < 0) - return ""; - - if (!len) - return ""; - - if (punct) - buflen=len*3; - else - buflen=len*2 + 1; - - buf=(gchar *)ep_alloc(buflen); - - if (punct) - bytes_to_hexstr_punct(buf, ad, len, punct); - else - bytes_to_hexstr(buf, ad, len); - - buf[buflen-1] = '\0'; - return buf; -} - const gchar * bytestring_to_str(wmem_allocator_t *scope, const guint8 *ad, const guint32 len, const char punct) { diff --git a/epan/to_str.h b/epan/to_str.h index de3fc7084d..b1892dda1a 100644 --- a/epan/to_str.h +++ b/epan/to_str.h @@ -145,9 +145,6 @@ WS_DLL_PUBLIC char *bytes_to_str(wmem_allocator_t *allocator, const guint8 *bd, */ WS_DLL_PUBLIC gchar *bytes_to_ep_str_punct(const guint8 *bd, int bd_len, gchar punct); -/* Deprecated, use bytestring_to_str instead */ -WS_DLL_PUBLIC const gchar *bytestring_to_ep_str(const guint8 *, const guint32, const char punct); - WS_DLL_PUBLIC const gchar *bytestring_to_str(wmem_allocator_t *scope, const guint8 *ad, const guint32 len, const char punct); #ifdef __cplusplus