aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2017-05-22 09:27:33 -0400
committerMichael Mann <mmann78@netscape.net>2017-05-22 15:28:10 +0000
commit96d483764ad8a11ee9e9f757b61d04411b030e75 (patch)
tree48c2cdcc9743d4208cd004e6258e79637db6f91b /epan
parentb3c68951913497d0797614636ef6784becb1a5b6 (diff)
Create temporary variables for some proto_tree_add_<datatype> calculations.
checkAPIs.pl doesn't like tvb_get_* parameters because it thinks proto_tree_add_item should be used. This is just to pacify the check. Change-Id: I2df1233fe8c7976c257197079c06d24e472303b5 Reviewed-on: https://code.wireshark.org/review/21735 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-ajp13.c9
-rw-r--r--epan/dissectors/packet-cip.c15
-rw-r--r--epan/dissectors/packet-ismp.c7
3 files changed, 18 insertions, 13 deletions
diff --git a/epan/dissectors/packet-ajp13.c b/epan/dissectors/packet-ajp13.c
index a8246abdd5..946fd413c4 100644
--- a/epan/dissectors/packet-ajp13.c
+++ b/epan/dissectors/packet-ajp13.c
@@ -694,7 +694,7 @@ display_req_forward(tvbuff_t *tvb, packet_info *pinfo,
guint8 aid;
const gchar* aname = NULL;
const gchar* aval;
- guint16 aval_len, aname_len;
+ guint16 aval_len, aname_len, key_len;
int apos = pos;
@@ -722,10 +722,9 @@ display_req_forward(tvbuff_t *tvb, packet_info *pinfo,
"%s: %s", aname, aval);
} else if (aid == 0x0B ) {
/* ssl_key_length */
- if (ajp13_tree) {
- proto_tree_add_uint(ajp13_tree, hf_ajp13_ssl_key_size,
- tvb, apos, 1+2, tvb_get_ntohs(tvb, pos));
- }
+ key_len = tvb_get_ntohs(tvb, pos);
+ proto_tree_add_uint(ajp13_tree, hf_ajp13_ssl_key_size,
+ tvb, apos, 1+2, key_len);
pos+=2;
} else {
diff --git a/epan/dissectors/packet-cip.c b/epan/dissectors/packet-cip.c
index ea8aaaa49d..b12e16f26b 100644
--- a/epan/dissectors/packet-cip.c
+++ b/epan/dissectors/packet-cip.c
@@ -3652,7 +3652,8 @@ dissect_cia(tvbuff_t *tvb, int offset, int pathpos, unsigned char segment_type,
if (generate)
{
- *ret_item = proto_tree_add_uint(item, hf_cip_ext_logical_type, tvb, 0, 0, tvb_get_guint8(tvb, offset + pathpos + 1));
+ temp_data = tvb_get_guint8(tvb, offset + pathpos + 1);
+ *ret_item = proto_tree_add_uint(item, hf_cip_ext_logical_type, tvb, 0, 0, temp_data);
PROTO_ITEM_SET_GENERATED(*ret_item);
}
else
@@ -4295,7 +4296,8 @@ static int dissect_cip_segment_single(packet_info *pinfo, tvbuff_t *tvb, int off
/* Add Link Address */
if ( generate )
{
- it = proto_tree_add_uint(port_tree, hf_cip_link_address_byte, tvb, 0, 0, tvb_get_guint8( tvb, offset + pathpos + offset_link_address ) );
+ temp_data = tvb_get_guint8( tvb, offset + pathpos + offset_link_address );
+ it = proto_tree_add_uint(port_tree, hf_cip_link_address_byte, tvb, 0, 0, temp_data);
PROTO_ITEM_SET_GENERATED(it);
}
else
@@ -4310,7 +4312,8 @@ static int dissect_cip_segment_single(packet_info *pinfo, tvbuff_t *tvb, int off
{
if (generate)
{
- it = proto_tree_add_uint(port_tree, hf_cip_port_extended, tvb, 0, 0, tvb_get_letohs(tvb, extended_port_offset));
+ temp_data = tvb_get_letohs(tvb, extended_port_offset);
+ it = proto_tree_add_uint(port_tree, hf_cip_port_extended, tvb, 0, 0, temp_data);
PROTO_ITEM_SET_GENERATED(it);
}
else
@@ -4690,7 +4693,8 @@ static int dissect_cip_segment_single(packet_info *pinfo, tvbuff_t *tvb, int off
case CI_NETWORK_SEG_SCHEDULE:
if (generate)
{
- it = proto_tree_add_uint(net_tree, hf_cip_seg_schedule, tvb, 0, 0, tvb_get_guint8(tvb, offset + pathpos + 1));
+ temp_data = tvb_get_guint8(tvb, offset + pathpos + 1);
+ it = proto_tree_add_uint(net_tree, hf_cip_seg_schedule, tvb, 0, 0, temp_data);
PROTO_ITEM_SET_GENERATED(it);
}
else
@@ -4707,7 +4711,8 @@ static int dissect_cip_segment_single(packet_info *pinfo, tvbuff_t *tvb, int off
case CI_NETWORK_SEG_FIXED_TAG:
if (generate)
{
- it = proto_tree_add_uint(net_tree, hf_cip_seg_fixed_tag, tvb, 0, 0, tvb_get_guint8(tvb, offset + pathpos + 1));
+ temp_data = tvb_get_guint8(tvb, offset + pathpos + 1);
+ it = proto_tree_add_uint(net_tree, hf_cip_seg_fixed_tag, tvb, 0, 0, temp_data);
PROTO_ITEM_SET_GENERATED(it);
}
else
diff --git a/epan/dissectors/packet-ismp.c b/epan/dissectors/packet-ismp.c
index d89b087754..1653da6285 100644
--- a/epan/dissectors/packet-ismp.c
+++ b/epan/dissectors/packet-ismp.c
@@ -249,6 +249,7 @@ dissect_ismp_edp(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *ismp
guint16 num_tuples = 0;
guint16 tuple_type = 0;
guint16 tuple_length = 0;
+ gchar* ipx_addr_str;
/* Set up structures needed to add the protocol subtree and manage it */
proto_item *edp_ti, *ti;
@@ -467,9 +468,9 @@ dissect_ismp_edp(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *ismp
proto_tree_add_item(edp_tuples_leaf_tree, hf_ismp_system_description, tvb, offset, tuple_length, ENC_NA|ENC_ASCII);
break;
case EDP_TUPLE_IPX_ADDR:
- proto_tree_add_string(edp_tuples_leaf_tree, hf_ismp_interface_ipx_address ,tvb, offset, tuple_length,
- ipx_addr_to_str(tvb_get_ntohl(tvb, offset),
- tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, tuple_length-4, ENC_ASCII)));
+ ipx_addr_str = ipx_addr_to_str(tvb_get_ntohl(tvb, offset),
+ tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, tuple_length-4, ENC_ASCII));
+ proto_tree_add_string(edp_tuples_leaf_tree, hf_ismp_interface_ipx_address ,tvb, offset, tuple_length, ipx_addr_str);
break;
case EDP_TUPLE_UNKNOWN:
default: