wmem: Remove wmem_strbuf_new_label()
Only dissectors are using this function and there is no use case, as far as I know, that requires its use. Any limitation of length is imposed transparently by the UI backend. This function is problematic because it is not Unicode aware and will truncate a string on an arbitrary byte boundary for multibyte strings. Replace its use with a normal strbuf without a length limite and remove the function because it is not useful and the ITEM_LABEL_LENGTH parameter does not belong in wmem anyway.
This commit is contained in:
parent
93814ef740
commit
729ea56b46
|
@ -1106,7 +1106,7 @@ dissect_aprs( tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *
|
||||||
|
|
||||||
dti = tvb_get_guint8( tvb, offset );
|
dti = tvb_get_guint8( tvb, offset );
|
||||||
|
|
||||||
sb = wmem_strbuf_new_label(wmem_packet_scope());
|
sb = wmem_strbuf_create(wmem_packet_scope());
|
||||||
|
|
||||||
if (dti != '!')
|
if (dti != '!')
|
||||||
wmem_strbuf_append(sb, val_to_str_ext_const(dti, &aprs_description_ext, ""));
|
wmem_strbuf_append(sb, val_to_str_ext_const(dti, &aprs_description_ext, ""));
|
||||||
|
|
|
@ -3409,7 +3409,7 @@ decode_bgp_rd(wmem_allocator_t *pool, tvbuff_t *tvb, gint offset)
|
||||||
wmem_strbuf_t *strbuf;
|
wmem_strbuf_t *strbuf;
|
||||||
|
|
||||||
rd_type = tvb_get_ntohs(tvb,offset);
|
rd_type = tvb_get_ntohs(tvb,offset);
|
||||||
strbuf = wmem_strbuf_new_label(pool);
|
strbuf = wmem_strbuf_create(pool);
|
||||||
|
|
||||||
switch (rd_type) {
|
switch (rd_type) {
|
||||||
case FORMAT_AS2_LOC:
|
case FORMAT_AS2_LOC:
|
||||||
|
@ -4390,7 +4390,7 @@ decode_mp_next_hop(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint16
|
||||||
int length, offset = 0;
|
int length, offset = 0;
|
||||||
wmem_strbuf_t *strbuf;
|
wmem_strbuf_t *strbuf;
|
||||||
|
|
||||||
strbuf = wmem_strbuf_new_label(pinfo->pool);
|
strbuf = wmem_strbuf_create(pinfo->pool);
|
||||||
|
|
||||||
/* BGP Multiprotocol Next Hop Principles
|
/* BGP Multiprotocol Next Hop Principles
|
||||||
*
|
*
|
||||||
|
@ -7045,7 +7045,7 @@ decode_prefix_MP(proto_tree *tree, int hf_path_id, int hf_addr4, int hf_addr6,
|
||||||
}
|
}
|
||||||
/* snarf length */
|
/* snarf length */
|
||||||
plen = tvb_get_guint8(tvb, offset);
|
plen = tvb_get_guint8(tvb, offset);
|
||||||
stack_strbuf = wmem_strbuf_new_label(pinfo->pool);
|
stack_strbuf = wmem_strbuf_create(pinfo->pool);
|
||||||
labnum = decode_MPLS_stack(tvb, offset + 1, stack_strbuf);
|
labnum = decode_MPLS_stack(tvb, offset + 1, stack_strbuf);
|
||||||
|
|
||||||
offset += (1 + labnum * 3);
|
offset += (1 + labnum * 3);
|
||||||
|
@ -7116,7 +7116,7 @@ decode_prefix_MP(proto_tree *tree, int hf_path_id, int hf_addr4, int hf_addr6,
|
||||||
}
|
}
|
||||||
|
|
||||||
length = (plen + 7)/8;
|
length = (plen + 7)/8;
|
||||||
comm_strbuf = wmem_strbuf_new_label(pinfo->pool);
|
comm_strbuf = wmem_strbuf_create(pinfo->pool);
|
||||||
|
|
||||||
switch (tvb_get_ntohs(tvb, offset + 1 + 4)) {
|
switch (tvb_get_ntohs(tvb, offset + 1 + 4)) {
|
||||||
case BGP_EXT_COM_RT_AS2:
|
case BGP_EXT_COM_RT_AS2:
|
||||||
|
@ -7203,7 +7203,7 @@ decode_prefix_MP(proto_tree *tree, int hf_path_id, int hf_addr4, int hf_addr6,
|
||||||
case SAFNUM_LAB_VPNMULCAST:
|
case SAFNUM_LAB_VPNMULCAST:
|
||||||
case SAFNUM_LAB_VPNUNIMULC:
|
case SAFNUM_LAB_VPNUNIMULC:
|
||||||
plen = tvb_get_guint8(tvb, offset);
|
plen = tvb_get_guint8(tvb, offset);
|
||||||
stack_strbuf = wmem_strbuf_new_label(pinfo->pool);
|
stack_strbuf = wmem_strbuf_create(pinfo->pool);
|
||||||
labnum = decode_MPLS_stack(tvb, offset + 1, stack_strbuf);
|
labnum = decode_MPLS_stack(tvb, offset + 1, stack_strbuf);
|
||||||
|
|
||||||
offset += (1 + labnum * 3);
|
offset += (1 + labnum * 3);
|
||||||
|
@ -7293,7 +7293,7 @@ decode_prefix_MP(proto_tree *tree, int hf_path_id, int hf_addr4, int hf_addr6,
|
||||||
}
|
}
|
||||||
/* snarf length */
|
/* snarf length */
|
||||||
plen = tvb_get_guint8(tvb, offset);
|
plen = tvb_get_guint8(tvb, offset);
|
||||||
stack_strbuf = wmem_strbuf_new_label(pinfo->pool);
|
stack_strbuf = wmem_strbuf_create(pinfo->pool);
|
||||||
labnum = decode_MPLS_stack(tvb, offset + 1, stack_strbuf);
|
labnum = decode_MPLS_stack(tvb, offset + 1, stack_strbuf);
|
||||||
|
|
||||||
offset += (1 + labnum * 3);
|
offset += (1 + labnum * 3);
|
||||||
|
@ -7402,7 +7402,7 @@ decode_prefix_MP(proto_tree *tree, int hf_path_id, int hf_addr4, int hf_addr6,
|
||||||
case SAFNUM_LAB_VPNMULCAST:
|
case SAFNUM_LAB_VPNMULCAST:
|
||||||
case SAFNUM_LAB_VPNUNIMULC:
|
case SAFNUM_LAB_VPNUNIMULC:
|
||||||
plen = tvb_get_guint8(tvb, offset);
|
plen = tvb_get_guint8(tvb, offset);
|
||||||
stack_strbuf = wmem_strbuf_new_label(pinfo->pool);
|
stack_strbuf = wmem_strbuf_create(pinfo->pool);
|
||||||
labnum = decode_MPLS_stack(tvb, offset + 1, stack_strbuf);
|
labnum = decode_MPLS_stack(tvb, offset + 1, stack_strbuf);
|
||||||
|
|
||||||
offset += (1 + labnum * 3);
|
offset += (1 + labnum * 3);
|
||||||
|
@ -7538,7 +7538,7 @@ decode_prefix_MP(proto_tree *tree, int hf_path_id, int hf_addr4, int hf_addr6,
|
||||||
|
|
||||||
proto_tree_add_item(tree, hf_bgp_vplsbgp_labelblock_offset, tvb, offset+12, 2, ENC_BIG_ENDIAN);
|
proto_tree_add_item(tree, hf_bgp_vplsbgp_labelblock_offset, tvb, offset+12, 2, ENC_BIG_ENDIAN);
|
||||||
proto_tree_add_item(tree, hf_bgp_vplsbgp_labelblock_size, tvb, offset+14, 2, ENC_BIG_ENDIAN);
|
proto_tree_add_item(tree, hf_bgp_vplsbgp_labelblock_size, tvb, offset+14, 2, ENC_BIG_ENDIAN);
|
||||||
stack_strbuf = wmem_strbuf_new_label(pinfo->pool);
|
stack_strbuf = wmem_strbuf_create(pinfo->pool);
|
||||||
decode_MPLS_stack(tvb, offset + 16, stack_strbuf);
|
decode_MPLS_stack(tvb, offset + 16, stack_strbuf);
|
||||||
proto_tree_add_string(tree, hf_bgp_vplsbgp_labelblock_base, tvb, offset+16, plen-14, wmem_strbuf_get_str(stack_strbuf));
|
proto_tree_add_string(tree, hf_bgp_vplsbgp_labelblock_base, tvb, offset+16, plen-14, wmem_strbuf_get_str(stack_strbuf));
|
||||||
|
|
||||||
|
@ -10011,7 +10011,7 @@ dissect_bgp_path_attr(proto_tree *subtree, tvbuff_t *tvb, guint16 path_attr_len,
|
||||||
q = o + i + aoff;
|
q = o + i + aoff;
|
||||||
end = q + tlen;
|
end = q + tlen;
|
||||||
wmem_strbuf_t *comm_strbuf;
|
wmem_strbuf_t *comm_strbuf;
|
||||||
comm_strbuf = wmem_strbuf_new_label(pinfo->pool);
|
comm_strbuf = wmem_strbuf_create(pinfo->pool);
|
||||||
while (q < end) {
|
while (q < end) {
|
||||||
guint32 ga, ldp1, ldp2;
|
guint32 ga, ldp1, ldp2;
|
||||||
ga = tvb_get_ntohl(tvb, q);
|
ga = tvb_get_ntohl(tvb, q);
|
||||||
|
@ -10416,7 +10416,7 @@ dissect_bgp_path_attr(proto_tree *subtree, tvbuff_t *tvb, guint16 path_attr_len,
|
||||||
q = o + i + aoff;
|
q = o + i + aoff;
|
||||||
end = q + tlen;
|
end = q + tlen;
|
||||||
wmem_strbuf_t *dpath_strbuf;
|
wmem_strbuf_t *dpath_strbuf;
|
||||||
dpath_strbuf = wmem_strbuf_new_label(pinfo->pool);
|
dpath_strbuf = wmem_strbuf_create(pinfo->pool);
|
||||||
guint8 dpath_len;
|
guint8 dpath_len;
|
||||||
dpath_len = tvb_get_guint8(tvb, q);
|
dpath_len = tvb_get_guint8(tvb, q);
|
||||||
proto_tree_add_item(subtree2, hf_bgp_d_path_length, tvb,
|
proto_tree_add_item(subtree2, hf_bgp_d_path_length, tvb,
|
||||||
|
|
|
@ -2158,7 +2158,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
|
||||||
gint protocol_order;
|
gint protocol_order;
|
||||||
wmem_strbuf_t *info_buf;
|
wmem_strbuf_t *info_buf;
|
||||||
|
|
||||||
info_buf = wmem_strbuf_new_label(pinfo->pool);
|
info_buf = wmem_strbuf_create(pinfo->pool);
|
||||||
*pinfo_buf = info_buf;
|
*pinfo_buf = info_buf;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ dissect_dmx_chan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
|
||||||
"0x%03x: %s",
|
"0x%03x: %s",
|
||||||
"%3u: %s"
|
"%3u: %s"
|
||||||
};
|
};
|
||||||
wmem_strbuf_t *chan_str = wmem_strbuf_new_label(pinfo->pool);
|
wmem_strbuf_t *chan_str = wmem_strbuf_create(pinfo->pool);
|
||||||
proto_item *item;
|
proto_item *item;
|
||||||
guint16 length,r,c,row_count;
|
guint16 length,r,c,row_count;
|
||||||
guint8 v;
|
guint8 v;
|
||||||
|
|
|
@ -2256,7 +2256,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
|
||||||
int port_num;
|
int port_num;
|
||||||
int i;
|
int i;
|
||||||
proto_item *ti_wks;
|
proto_item *ti_wks;
|
||||||
wmem_strbuf_t *bitnames = wmem_strbuf_new_label(wmem_packet_scope());
|
wmem_strbuf_t *bitnames = wmem_strbuf_create(wmem_packet_scope());
|
||||||
|
|
||||||
wks_addr = tvb_ip_to_str(pinfo->pool, tvb, cur_offset);
|
wks_addr = tvb_ip_to_str(pinfo->pool, tvb, cur_offset);
|
||||||
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", wks_addr);
|
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", wks_addr);
|
||||||
|
|
|
@ -255,7 +255,7 @@ dissect_enttec_dmx_data(tvbuff_t *tvb, guint offset, proto_tree *tree)
|
||||||
si = proto_item_add_subtree(hi, ett_enttec);
|
si = proto_item_add_subtree(hi, ett_enttec);
|
||||||
|
|
||||||
row_count = (ui/global_disp_col_count) + ((ui%global_disp_col_count) == 0 ? 0 : 1);
|
row_count = (ui/global_disp_col_count) + ((ui%global_disp_col_count) == 0 ? 0 : 1);
|
||||||
dmx_epstr = wmem_strbuf_new_label(wmem_packet_scope());
|
dmx_epstr = wmem_strbuf_create(wmem_packet_scope());
|
||||||
for (r=0; r < row_count;r++) {
|
for (r=0; r < row_count;r++) {
|
||||||
for (c=0;(c < global_disp_col_count) && (((r*global_disp_col_count)+c) < ui);c++) {
|
for (c=0;(c < global_disp_col_count) && (((r*global_disp_col_count)+c) < ui);c++) {
|
||||||
if ((global_disp_col_count > 1) && (c % (global_disp_col_count/2)) == 0) {
|
if ((global_disp_col_count > 1) && (c % (global_disp_col_count/2)) == 0) {
|
||||||
|
|
|
@ -1704,7 +1704,7 @@ dissect_channelised_ex_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
|
||||||
guint8 vc_size = (guint8)((hdr >> 16) & 0xFF);
|
guint8 vc_size = (guint8)((hdr >> 16) & 0xFF);
|
||||||
guint8 line_rate = (guint8)((hdr >> 8) & 0xFF);
|
guint8 line_rate = (guint8)((hdr >> 8) & 0xFF);
|
||||||
sdh_g707_format_t g707_format;
|
sdh_g707_format_t g707_format;
|
||||||
wmem_strbuf_t *vc_id_string = wmem_strbuf_new_label(pinfo->pool);
|
wmem_strbuf_t *vc_id_string = wmem_strbuf_create(pinfo->pool);
|
||||||
|
|
||||||
channelised_fill_sdh_g707_format(&g707_format, vc_id, vc_size, line_rate);
|
channelised_fill_sdh_g707_format(&g707_format, vc_id, vc_size, line_rate);
|
||||||
channelised_fill_vc_id_string(vc_id_string, &g707_format);
|
channelised_fill_vc_id_string(vc_id_string, &g707_format);
|
||||||
|
|
|
@ -513,7 +513,7 @@ read_number(unsigned int *offset, tvbuff_t *tvb, proto_tree *etch_tree,
|
||||||
const gchar *symbol = NULL;
|
const gchar *symbol = NULL;
|
||||||
guint32 hash = 0;
|
guint32 hash = 0;
|
||||||
|
|
||||||
gbl_symbol_buffer = wmem_strbuf_new_label(wmem_packet_scope()); /* no symbol found yet */
|
gbl_symbol_buffer = wmem_strbuf_create(wmem_packet_scope()); /* no symbol found yet */
|
||||||
if (byteLength == 4) {
|
if (byteLength == 4) {
|
||||||
hash = tvb_get_ntohl(tvb, *offset);
|
hash = tvb_get_ntohl(tvb, *offset);
|
||||||
symbol = try_val_to_str_ext(hash, gbl_symbols_vs_ext);
|
symbol = try_val_to_str_ext(hash, gbl_symbols_vs_ext);
|
||||||
|
@ -667,7 +667,7 @@ get_column_info(tvbuff_t *tvb)
|
||||||
int my_offset = 0;
|
int my_offset = 0;
|
||||||
|
|
||||||
/* We've a full PDU: 8 bytes + pdu_packetlen bytes */
|
/* We've a full PDU: 8 bytes + pdu_packetlen bytes */
|
||||||
result_buf = wmem_strbuf_new_label(wmem_packet_scope());
|
result_buf = wmem_strbuf_create(wmem_packet_scope());
|
||||||
|
|
||||||
my_offset += (4 + 4 + 1); /* skip Magic, Length, Version */
|
my_offset += (4 + 4 + 1); /* skip Magic, Length, Version */
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
||||||
static const char fw1_header[] = "FW1 Monitor";
|
static const char fw1_header[] = "FW1 Monitor";
|
||||||
ethertype_data_t ethertype_data;
|
ethertype_data_t ethertype_data;
|
||||||
|
|
||||||
header = wmem_strbuf_new_label(pinfo->pool);
|
header = wmem_strbuf_create(pinfo->pool);
|
||||||
wmem_strbuf_append(header, fw1_header);
|
wmem_strbuf_append(header, fw1_header);
|
||||||
|
|
||||||
/* Make entries in Protocol column and Info column on summary display */
|
/* Make entries in Protocol column and Info column on summary display */
|
||||||
|
|
|
@ -4377,7 +4377,7 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
|
||||||
case ICMP6_ND_NEIGHBOR_ADVERT: /* Neighbor Advertisement (136) */
|
case ICMP6_ND_NEIGHBOR_ADVERT: /* Neighbor Advertisement (136) */
|
||||||
{
|
{
|
||||||
guint32 na_flags;
|
guint32 na_flags;
|
||||||
wmem_strbuf_t *flags_strbuf = wmem_strbuf_new_label(pinfo->pool);
|
wmem_strbuf_t *flags_strbuf = wmem_strbuf_create(pinfo->pool);
|
||||||
static int * const nd_na_flags[] = {
|
static int * const nd_na_flags[] = {
|
||||||
&hf_icmpv6_nd_na_flag_r,
|
&hf_icmpv6_nd_na_flag_r,
|
||||||
&hf_icmpv6_nd_na_flag_s,
|
&hf_icmpv6_nd_na_flag_s,
|
||||||
|
|
|
@ -1665,7 +1665,7 @@ static int dissect_iec60870_asdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
|
||||||
it104 = proto_tree_add_item(tree, proto_iec60870_asdu, tvb, offset, -1, ENC_NA);
|
it104 = proto_tree_add_item(tree, proto_iec60870_asdu, tvb, offset, -1, ENC_NA);
|
||||||
it104tree = proto_item_add_subtree(it104, ett_asdu);
|
it104tree = proto_item_add_subtree(it104, ett_asdu);
|
||||||
|
|
||||||
res = wmem_strbuf_new_label(pinfo->pool);
|
res = wmem_strbuf_create(pinfo->pool);
|
||||||
|
|
||||||
/* Type identification */
|
/* Type identification */
|
||||||
asduh.TypeId = tvb_get_guint8(tvb, offset);
|
asduh.TypeId = tvb_get_guint8(tvb, offset);
|
||||||
|
@ -2074,7 +2074,7 @@ static int dissect_iec60870_104(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
|
||||||
it104 = proto_tree_add_item(tree, proto_iec60870_104, tvb, 0, -1, ENC_NA);
|
it104 = proto_tree_add_item(tree, proto_iec60870_104, tvb, 0, -1, ENC_NA);
|
||||||
it104tree = proto_item_add_subtree(it104, ett_apci);
|
it104tree = proto_item_add_subtree(it104, ett_apci);
|
||||||
|
|
||||||
res = wmem_strbuf_new_label(pinfo->pool);
|
res = wmem_strbuf_create(pinfo->pool);
|
||||||
|
|
||||||
Start = 0;
|
Start = 0;
|
||||||
for (Off = 0; Off <= TcpLen - 2; Off++) {
|
for (Off = 0; Off <= TcpLen - 2; Off++) {
|
||||||
|
|
|
@ -8906,7 +8906,7 @@ dissect_dscp_policy_response(tvbuff_t *tvb, packet_info *pinfo,
|
||||||
{
|
{
|
||||||
int start_offset = offset;
|
int start_offset = offset;
|
||||||
guint8 count;
|
guint8 count;
|
||||||
wmem_strbuf_t *status_buf = wmem_strbuf_new_label(pinfo->pool);
|
wmem_strbuf_t *status_buf = wmem_strbuf_create(pinfo->pool);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
proto_tree_add_bitmask(tree, tvb, offset,
|
proto_tree_add_bitmask(tree, tvb, offset,
|
||||||
|
|
|
@ -1308,9 +1308,9 @@ static int dissect_jxta_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree
|
||||||
return -needed;
|
return -needed;
|
||||||
}
|
}
|
||||||
|
|
||||||
src_addr = wmem_strbuf_new_label(pinfo->pool);
|
src_addr = wmem_strbuf_create(pinfo->pool);
|
||||||
wmem_strbuf_append(src_addr, address_to_str(pinfo->pool, &pinfo->src));
|
wmem_strbuf_append(src_addr, address_to_str(pinfo->pool, &pinfo->src));
|
||||||
dst_addr = wmem_strbuf_new_label(pinfo->pool);
|
dst_addr = wmem_strbuf_create(pinfo->pool);
|
||||||
wmem_strbuf_append(dst_addr, address_to_str(pinfo->pool, &pinfo->dst));
|
wmem_strbuf_append(dst_addr, address_to_str(pinfo->pool, &pinfo->dst));
|
||||||
|
|
||||||
/* append the port if appropriate */
|
/* append the port if appropriate */
|
||||||
|
|
|
@ -120,7 +120,7 @@ static int dissect_miop (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
|
||||||
|
|
||||||
guint32 unique_id_len;
|
guint32 unique_id_len;
|
||||||
|
|
||||||
wmem_strbuf_t *flags_strbuf = wmem_strbuf_new_label(pinfo->pool);
|
wmem_strbuf_t *flags_strbuf = wmem_strbuf_create(pinfo->pool);
|
||||||
wmem_strbuf_append(flags_strbuf, "none");
|
wmem_strbuf_append(flags_strbuf, "none");
|
||||||
|
|
||||||
if (!dissect_miop_heur_check(tvb, pinfo, tree, data))
|
if (!dissect_miop_heur_check(tvb, pinfo, tree, data))
|
||||||
|
|
|
@ -237,7 +237,7 @@ dissect_netanalyzer_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||||
|
|
||||||
proto_tree_add_bitmask(netanalyzer_header_tree, tvb, 0, hf_netanalyzer_status, ett_netanalyzer_status, hfx_netanalyzer_status, ENC_LITTLE_ENDIAN);
|
proto_tree_add_bitmask(netanalyzer_header_tree, tvb, 0, hf_netanalyzer_status, ett_netanalyzer_status, hfx_netanalyzer_status, ENC_LITTLE_ENDIAN);
|
||||||
|
|
||||||
strbuf = wmem_strbuf_new_label(pinfo->pool);
|
strbuf = wmem_strbuf_create(pinfo->pool);
|
||||||
for (idx = 0; idx < 8; idx++)
|
for (idx = 0; idx < 8; idx++)
|
||||||
{
|
{
|
||||||
if (packet_status & (1 << idx))
|
if (packet_status & (1 << idx))
|
||||||
|
|
|
@ -1057,7 +1057,7 @@ static int dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Ack_PDU:
|
case Ack_PDU:
|
||||||
message_id_list = wmem_strbuf_new_label(pinfo->pool);
|
message_id_list = wmem_strbuf_create(pinfo->pool);
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
/* Ack Info Entry */
|
/* Ack Info Entry */
|
||||||
|
|
|
@ -3367,7 +3367,7 @@ static void append_status_info(packet_info *pinfo,
|
||||||
gchar * writerId = NULL;
|
gchar * writerId = NULL;
|
||||||
gchar * disposeFlag = NULL;
|
gchar * disposeFlag = NULL;
|
||||||
gchar * unregisterFlag = NULL;
|
gchar * unregisterFlag = NULL;
|
||||||
wmem_strbuf_t *buffer = wmem_strbuf_new_label(wmem_packet_scope());
|
wmem_strbuf_t *buffer = wmem_strbuf_create(wmem_packet_scope());
|
||||||
|
|
||||||
switch(writer_id) {
|
switch(writer_id) {
|
||||||
case ENTITYID_PARTICIPANT:
|
case ENTITYID_PARTICIPANT:
|
||||||
|
@ -5231,7 +5231,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t *tvb, gint offset,
|
||||||
/* Array print */
|
/* Array print */
|
||||||
if (arr_dimension != NULL) {
|
if (arr_dimension != NULL) {
|
||||||
/* Printing an array */
|
/* Printing an array */
|
||||||
wmem_strbuf_t *dim_str = wmem_strbuf_new_label(wmem_packet_scope());
|
wmem_strbuf_t *dim_str = wmem_strbuf_create(wmem_packet_scope());
|
||||||
for (i = 0; i < MAX_ARRAY_DIMENSION; ++i) {
|
for (i = 0; i < MAX_ARRAY_DIMENSION; ++i) {
|
||||||
if (arr_dimension[i] != 0) {
|
if (arr_dimension[i] != 0) {
|
||||||
wmem_strbuf_append_printf(dim_str, "[%d]", arr_dimension[i]);
|
wmem_strbuf_append_printf(dim_str, "[%d]", arr_dimension[i]);
|
||||||
|
@ -6042,8 +6042,8 @@ static int rtps_util_add_bitmap(proto_tree *tree,
|
||||||
gboolean show_analysis) {
|
gboolean show_analysis) {
|
||||||
gint32 num_bits;
|
gint32 num_bits;
|
||||||
guint32 data;
|
guint32 data;
|
||||||
wmem_strbuf_t *temp_buff = wmem_strbuf_new_label(wmem_packet_scope());
|
wmem_strbuf_t *temp_buff = wmem_strbuf_create(wmem_packet_scope());
|
||||||
wmem_strbuf_t *analysis_buff = wmem_strbuf_new_label(wmem_packet_scope());
|
wmem_strbuf_t *analysis_buff = wmem_strbuf_create(wmem_packet_scope());
|
||||||
gint i, j, idx;
|
gint i, j, idx;
|
||||||
gchar *last_one;
|
gchar *last_one;
|
||||||
proto_item *ti = NULL, *ti_tree = NULL;
|
proto_item *ti = NULL, *ti_tree = NULL;
|
||||||
|
@ -6141,7 +6141,7 @@ static int rtps_util_add_fragment_number_set(proto_tree *tree, packet_info *pinf
|
||||||
guint64 base;
|
guint64 base;
|
||||||
gint32 num_bits;
|
gint32 num_bits;
|
||||||
guint32 data;
|
guint32 data;
|
||||||
wmem_strbuf_t *temp_buff = wmem_strbuf_new_label(wmem_packet_scope());
|
wmem_strbuf_t *temp_buff = wmem_strbuf_create(wmem_packet_scope());
|
||||||
gchar *last_one;
|
gchar *last_one;
|
||||||
int i, j, idx;
|
int i, j, idx;
|
||||||
proto_item *ti;
|
proto_item *ti;
|
||||||
|
|
|
@ -3179,7 +3179,7 @@ s7comm_decode_pistart_parameters(tvbuff_t *tvb,
|
||||||
guint8 i;
|
guint8 i;
|
||||||
guint8 len;
|
guint8 len;
|
||||||
wmem_strbuf_t *args_buf;
|
wmem_strbuf_t *args_buf;
|
||||||
args_buf = wmem_strbuf_new_label(pinfo->pool);
|
args_buf = wmem_strbuf_create(pinfo->pool);
|
||||||
|
|
||||||
for (i = 0; i < nfields; i++) {
|
for (i = 0; i < nfields; i++) {
|
||||||
len = tvb_get_guint8(tvb, offset);
|
len = tvb_get_guint8(tvb, offset);
|
||||||
|
|
|
@ -514,7 +514,7 @@ static void dissect_dereg_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pay
|
||||||
proto_tree *dereg_req_data;
|
proto_tree *dereg_req_data;
|
||||||
guint8 reason_flag;
|
guint8 reason_flag;
|
||||||
static gboolean first_flag = TRUE;
|
static gboolean first_flag = TRUE;
|
||||||
wmem_strbuf_t *reasonflags_strbuf = wmem_strbuf_new_label(pinfo->pool);
|
wmem_strbuf_t *reasonflags_strbuf = wmem_strbuf_create(pinfo->pool);
|
||||||
static const gchar *fstr[] = {"No Reason", "Learned & Purposeful" };
|
static const gchar *fstr[] = {"No Reason", "Learned & Purposeful" };
|
||||||
|
|
||||||
dereg_req_data = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_dereg_req_sz, NULL, "DeReg Request");
|
dereg_req_data = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_dereg_req_sz, NULL, "DeReg Request");
|
||||||
|
|
|
@ -1983,7 +1983,7 @@ decode_lcd_line_cmd(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
|
||||||
if (!ua3g_body_tree)
|
if (!ua3g_body_tree)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
strbuf = wmem_strbuf_new_label(pinfo->pool);
|
strbuf = wmem_strbuf_create(pinfo->pool);
|
||||||
|
|
||||||
wmem_strbuf_append_printf(strbuf, "\"%s\"", tvb_format_text(pinfo->pool, tvb, offset + 2, length - 2));
|
wmem_strbuf_append_printf(strbuf, "\"%s\"", tvb_format_text(pinfo->pool, tvb, offset + 2, length - 2));
|
||||||
|
|
||||||
|
@ -2803,7 +2803,7 @@ decode_audio_config(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
|
||||||
int j;
|
int j;
|
||||||
int device_index = 0;
|
int device_index = 0;
|
||||||
|
|
||||||
strbuf = wmem_strbuf_new_label(pinfo->pool);
|
strbuf = wmem_strbuf_create(pinfo->pool);
|
||||||
|
|
||||||
while (length > 0) {
|
while (length > 0) {
|
||||||
|
|
||||||
|
|
|
@ -236,7 +236,7 @@ dissect_flags(tvbuff_t *tvb, int offset, proto_tree *tree)
|
||||||
|
|
||||||
if (flags != 0)
|
if (flags != 0)
|
||||||
{
|
{
|
||||||
wmem_strbuf_t *strbuf = wmem_strbuf_new_label(wmem_packet_scope());
|
wmem_strbuf_t *strbuf = wmem_strbuf_create(wmem_packet_scope());
|
||||||
|
|
||||||
if (flags & VXI11_CORE_FLAG_WAITLOCK)
|
if (flags & VXI11_CORE_FLAG_WAITLOCK)
|
||||||
{
|
{
|
||||||
|
@ -281,7 +281,7 @@ dissect_reason(tvbuff_t *tvb, int offset, proto_tree *tree)
|
||||||
|
|
||||||
if (reason != 0)
|
if (reason != 0)
|
||||||
{
|
{
|
||||||
wmem_strbuf_t *strbuf = wmem_strbuf_new_label(wmem_packet_scope());
|
wmem_strbuf_t *strbuf = wmem_strbuf_create(wmem_packet_scope());
|
||||||
|
|
||||||
if (reason & VXI11_CORE_REASON_REQCNT)
|
if (reason & VXI11_CORE_REASON_REQCNT)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1546,18 +1546,18 @@ dissect_nt_sid(tvbuff_t *tvb, int offset, proto_tree *parent_tree,
|
||||||
offset++;
|
offset++;
|
||||||
}
|
}
|
||||||
|
|
||||||
sid_in_dec_str = wmem_strbuf_new_label(wmem_packet_scope());
|
sid_in_dec_str = wmem_strbuf_create(wmem_packet_scope());
|
||||||
wmem_strbuf_append_printf (sid_in_dec_str, "S-%u-%" PRIu64, revision, authority);
|
wmem_strbuf_append_printf (sid_in_dec_str, "S-%u-%" PRIu64, revision, authority);
|
||||||
|
|
||||||
/* If sid_display_hex is set, sid_in_dec_str is still needed for
|
/* If sid_display_hex is set, sid_in_dec_str is still needed for
|
||||||
looking up well-known SIDs*/
|
looking up well-known SIDs*/
|
||||||
if (sid_display_hex) {
|
if (sid_display_hex) {
|
||||||
sid_in_hex_str = wmem_strbuf_new_label(wmem_packet_scope());
|
sid_in_hex_str = wmem_strbuf_create(wmem_packet_scope());
|
||||||
wmem_strbuf_append_printf (sid_in_hex_str, "S-%x-%" PRIx64, revision, authority);
|
wmem_strbuf_append_printf (sid_in_hex_str, "S-%x-%" PRIx64, revision, authority);
|
||||||
}
|
}
|
||||||
|
|
||||||
wkwn_sid1_str = wmem_strbuf_new_label(wmem_packet_scope());
|
wkwn_sid1_str = wmem_strbuf_create(wmem_packet_scope());
|
||||||
label_str = wmem_strbuf_new_label(wmem_packet_scope());
|
label_str = wmem_strbuf_create(wmem_packet_scope());
|
||||||
|
|
||||||
if (strcmp(wmem_strbuf_get_str(sid_in_dec_str), "S-1-16")==0)
|
if (strcmp(wmem_strbuf_get_str(sid_in_dec_str), "S-1-16")==0)
|
||||||
S_1_16 = TRUE;
|
S_1_16 = TRUE;
|
||||||
|
@ -1582,9 +1582,9 @@ dissect_nt_sid(tvbuff_t *tvb, int offset, proto_tree *parent_tree,
|
||||||
|
|
||||||
|
|
||||||
sa_offset = offset;
|
sa_offset = offset;
|
||||||
sa_str = wmem_strbuf_new_label(wmem_packet_scope());
|
sa_str = wmem_strbuf_create(wmem_packet_scope());
|
||||||
wkwn_sid2_str = wmem_strbuf_new_label(wmem_packet_scope());
|
wkwn_sid2_str = wmem_strbuf_create(wmem_packet_scope());
|
||||||
domain_str = wmem_strbuf_new_label(wmem_packet_scope());
|
domain_str = wmem_strbuf_create(wmem_packet_scope());
|
||||||
|
|
||||||
/* Build the sub-authorities and full SID strings */
|
/* Build the sub-authorities and full SID strings */
|
||||||
for(i=1; i<num_auth+1; i++) {
|
for(i=1; i<num_auth+1; i++) {
|
||||||
|
|
|
@ -1319,7 +1319,7 @@ static void colorFlags(tvbuff_t *tvb, int *offsetp, proto_tree *t)
|
||||||
|
|
||||||
if (do_red_green_blue) {
|
if (do_red_green_blue) {
|
||||||
int sep = FALSE;
|
int sep = FALSE;
|
||||||
wmem_strbuf_t *buffer = wmem_strbuf_new_label(wmem_packet_scope());
|
wmem_strbuf_t *buffer = wmem_strbuf_create(wmem_packet_scope());
|
||||||
wmem_strbuf_append(buffer, "flags: ");
|
wmem_strbuf_append(buffer, "flags: ");
|
||||||
|
|
||||||
if (do_red_green_blue & 0x1) {
|
if (do_red_green_blue & 0x1) {
|
||||||
|
@ -1517,7 +1517,7 @@ static void listOfColorItem(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
|
||||||
wmem_strbuf_t *buffer;
|
wmem_strbuf_t *buffer;
|
||||||
const char *sep;
|
const char *sep;
|
||||||
|
|
||||||
buffer=wmem_strbuf_new_label(wmem_packet_scope());
|
buffer=wmem_strbuf_create(wmem_packet_scope());
|
||||||
wmem_strbuf_append(buffer, "colorItem ");
|
wmem_strbuf_append(buffer, "colorItem ");
|
||||||
red = tvb_get_guint16(tvb, *offsetp + 4, byte_order);
|
red = tvb_get_guint16(tvb, *offsetp + 4, byte_order);
|
||||||
green = tvb_get_guint16(tvb, *offsetp + 6, byte_order);
|
green = tvb_get_guint16(tvb, *offsetp + 6, byte_order);
|
||||||
|
|
|
@ -58,14 +58,14 @@ wmem_strbuf_sized_new(wmem_allocator_t *allocator,
|
||||||
size_t alloc_size, size_t max_size)
|
size_t alloc_size, size_t max_size)
|
||||||
G_GNUC_MALLOC;
|
G_GNUC_MALLOC;
|
||||||
|
|
||||||
#define wmem_strbuf_new_label(ALLOCATOR) \
|
|
||||||
wmem_strbuf_sized_new((ALLOCATOR), 0, ITEM_LABEL_LENGTH)
|
|
||||||
|
|
||||||
WS_DLL_PUBLIC
|
WS_DLL_PUBLIC
|
||||||
wmem_strbuf_t *
|
wmem_strbuf_t *
|
||||||
wmem_strbuf_new(wmem_allocator_t *allocator, const gchar *str)
|
wmem_strbuf_new(wmem_allocator_t *allocator, const gchar *str)
|
||||||
G_GNUC_MALLOC;
|
G_GNUC_MALLOC;
|
||||||
|
|
||||||
|
#define wmem_strbuf_create(allocator) \
|
||||||
|
wmem_strbuf_new(allocator, "")
|
||||||
|
|
||||||
WS_DLL_PUBLIC
|
WS_DLL_PUBLIC
|
||||||
wmem_strbuf_t *
|
wmem_strbuf_t *
|
||||||
wmem_strbuf_new_len(wmem_allocator_t *allocator, const gchar *str, size_t len)
|
wmem_strbuf_new_len(wmem_allocator_t *allocator, const gchar *str, size_t len)
|
||||||
|
|
Loading…
Reference in New Issue