aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-btbnep.c
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2014-07-23 12:26:05 +0200
committerMichal Labedzki <michal.labedzki@tieto.com>2014-09-22 10:52:03 +0000
commit56a09d24dcdcaddae1cb67a18bbc2fd588c427ed (patch)
treea9961e4700a00680f7247d714709e6164f9e5d9d /epan/dissectors/packet-btbnep.c
parentc1d6a4123a2e100a77ae8ec2b3d01544f168febc (diff)
Try to fix some buildbot warnings
Most interesting are: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations] warning: ISO C forbids zero-size array [-Wpedantic] warning: ISO C90 doesn't support unnamed structs/unions [-Wpedantic] warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual warning: initializer element is not computable at load time [enabled by default] Change-Id: I5573c6bdca856a304877d9bef643f8c0fa93cdaf Reviewed-on: https://code.wireshark.org/review/3174 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'epan/dissectors/packet-btbnep.c')
-rw-r--r--epan/dissectors/packet-btbnep.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-btbnep.c b/epan/dissectors/packet-btbnep.c
index 20a3d27343..6c430b73b1 100644
--- a/epan/dissectors/packet-btbnep.c
+++ b/epan/dissectors/packet-btbnep.c
@@ -154,7 +154,7 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
guint16 uuid_dst;
guint16 uuid_src;
guint16 response_message;
- guint list_length;
+ guint16 list_length;
guint i_item;
proto_tree_add_item(tree, hf_btbnep_control_type, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -203,7 +203,7 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
list_length = tvb_get_ntohs(tvb, offset);
offset += 2;
- for (i_item = 0; i_item < list_length; i_item += 4) {
+ for (i_item = 0; i_item + 4 > i_item && i_item < list_length; i_item += 4) {
proto_tree_add_item(tree, hf_btbnep_network_type_start, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
@@ -223,7 +223,7 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
list_length = tvb_get_ntohs(tvb, offset);
offset += 2;
- for (i_item = 0; i_item < list_length; i_item += 12) {
+ for (i_item = 0; i_item + 12 > i_item && i_item < list_length; i_item += 12) {
proto_tree_add_item(tree, hf_btbnep_multicast_address_start, tvb, offset, 6, ENC_NA);
offset += 6;