diff options
author | Evan Huus <eapache@gmail.com> | 2014-05-25 11:13:04 -0400 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2014-05-25 18:12:00 +0000 |
commit | 08ce84ebbe91eaaccd8bbf8c8d43c8cecfc7945a (patch) | |
tree | 1ee03c6b55a52e996fbf1ec25befe127cb071385 /epan/dissectors/packet-asterix.c | |
parent | c4ead251da7199cfd746d378c51eb8c30d09a6ba (diff) | |
download | wireshark-08ce84ebbe91eaaccd8bbf8c8d43c8cecfc7945a.tar.gz |
Grab-bag of dead initializers and two actual bugs.
All caught by cppcheck. The two (semi)-interesting bugs are:
- in asn1/atn-cpdlc/packet-atn-cpdlc-template.c where the break statement should
have been inside the brace, causing potential control-flow weirdness with
exceptions
- in epan/dissectors/packet-ieee80211.c where the bounds check for tag_len did
not match the expert info given
Change-Id: Ie173fb8d917aabb9b4571435d671d6f16e1c7569
Reviewed-on: https://code.wireshark.org/review/1793
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-asterix.c')
-rw-r--r-- | epan/dissectors/packet-asterix.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/epan/dissectors/packet-asterix.c b/epan/dissectors/packet-asterix.c index 759e0f0b76..a2b3649851 100644 --- a/epan/dissectors/packet-asterix.c +++ b/epan/dissectors/packet-asterix.c @@ -7005,15 +7005,13 @@ static void dissect_asterix_packet (tvbuff_t *tvb, proto_tree *tree) guint i; guint8 category; guint16 length; - proto_item *asterix_packet_item = NULL; - proto_tree *asterix_packet_tree = NULL; + proto_item *asterix_packet_item; + proto_tree *asterix_packet_tree; for (i = 0; i < tvb_reported_length (tvb); i += length + 3) { category = tvb_get_guint8 (tvb, i); length = (tvb_get_guint8 (tvb, i + 1) << 8) + tvb_get_guint8 (tvb, i + 2) - 3; /* -3 for category and length */ - asterix_packet_item = NULL; - asterix_packet_tree = NULL; asterix_packet_item = proto_tree_add_item (tree, proto_asterix, tvb, i, length + 3, ENC_NA); proto_item_append_text (asterix_packet_item, ", Category %03d", category); asterix_packet_tree = proto_item_add_subtree (asterix_packet_item, ett_asterix); @@ -7117,7 +7115,6 @@ static void asterix_build_subtree (tvbuff_t *tvb, guint offset, proto_tree *pare if (field->part != NULL) { for (i = 0, inner_offset = 0, go_on = 1; go_on && field->part[i] != NULL; i++) { - value = G_GINT64_CONSTANT(0);; value = tvb_get_bits64 (tvb, offset * 8 + inner_offset, field->part[i]->bit_length, ENC_BIG_ENDIAN); if (field->part[i]->hf != NULL) { switch (field->part[i]->type) { |