diff options
author | Bill Meier <wmeier@newsguy.com> | 2012-06-12 21:22:46 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2012-06-12 21:22:46 +0000 |
commit | 1b17369504e600fbddc53c67d634039ba37ac6b7 (patch) | |
tree | 3bf66240055157786e65245a2966939bf0d571c7 /epan/dissectors/packet-moldudp64.c | |
parent | 5b53b81835a64b5219236922c7c91e7d9c3c1efb (diff) |
Fix: code under 'if(tree)' (in)directly calls sub-dissector/col_...()/expert...() fcns
svn path=/trunk/; revision=43226
Diffstat (limited to 'epan/dissectors/packet-moldudp64.c')
-rw-r--r-- | epan/dissectors/packet-moldudp64.c | 61 |
1 files changed, 29 insertions, 32 deletions
diff --git a/epan/dissectors/packet-moldudp64.c b/epan/dissectors/packet-moldudp64.c index 79b186bdd8..df751eeb84 100644 --- a/epan/dissectors/packet-moldudp64.c +++ b/epan/dissectors/packet-moldudp64.c @@ -148,48 +148,45 @@ dissect_moldudp64(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) else col_set_str(pinfo->cinfo, COL_INFO, "MoldUDP64 Messages"); - if (tree) - { - /* create display subtree for the protocol */ - ti = proto_tree_add_item(tree, proto_moldudp64, - tvb, offset, -1, ENC_NA); + /* create display subtree for the protocol */ + ti = proto_tree_add_item(tree, proto_moldudp64, + tvb, offset, -1, ENC_NA); - moldudp64_tree = proto_item_add_subtree(ti, ett_moldudp64); + moldudp64_tree = proto_item_add_subtree(ti, ett_moldudp64); - proto_tree_add_item(moldudp64_tree, hf_moldudp64_session, - tvb, offset, MOLDUDP64_SESSION_LEN, ENC_ASCII|ENC_NA); - offset += MOLDUDP64_SESSION_LEN; + proto_tree_add_item(moldudp64_tree, hf_moldudp64_session, + tvb, offset, MOLDUDP64_SESSION_LEN, ENC_ASCII|ENC_NA); + offset += MOLDUDP64_SESSION_LEN; - proto_tree_add_item(moldudp64_tree, hf_moldudp64_sequence, - tvb, offset, MOLDUDP64_SEQUENCE_LEN, ENC_BIG_ENDIAN); - offset += MOLDUDP64_SEQUENCE_LEN; + proto_tree_add_item(moldudp64_tree, hf_moldudp64_sequence, + tvb, offset, MOLDUDP64_SEQUENCE_LEN, ENC_BIG_ENDIAN); + offset += MOLDUDP64_SEQUENCE_LEN; - ti = proto_tree_add_item(moldudp64_tree, hf_moldudp64_count, - tvb, offset, MOLDUDP64_COUNT_LEN, ENC_BIG_ENDIAN); - offset += MOLDUDP64_COUNT_LEN; + ti = proto_tree_add_item(moldudp64_tree, hf_moldudp64_count, + tvb, offset, MOLDUDP64_COUNT_LEN, ENC_BIG_ENDIAN); + offset += MOLDUDP64_COUNT_LEN; - while (tvb_reported_length(tvb) >= offset + MOLDUDP64_MSGLEN_LEN) - { - offset += dissect_moldudp64_msgblk(tvb, pinfo, moldudp64_tree, - offset, sequence++); - real_count++; - } + while (tvb_reported_length(tvb) >= offset + MOLDUDP64_MSGLEN_LEN) + { + offset += dissect_moldudp64_msgblk(tvb, pinfo, moldudp64_tree, + offset, sequence++); + real_count++; + } - if (count == MOLDUDP64_ENDOFSESS) - { - if (real_count != 0) - { - expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR, - "End Of Session packet with extra data."); - } - } - else if (real_count != count) + if (count == MOLDUDP64_ENDOFSESS) + { + if (real_count != 0) { expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR, - "Invalid Message Count (claimed %u, found %u)", - count, real_count); + "End Of Session packet with extra data."); } } + else if (real_count != count) + { + expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR, + "Invalid Message Count (claimed %u, found %u)", + count, real_count); + } /* Return the amount of data this dissector was able to dissect */ return tvb_length(tvb); |