diff options
author | Anders Broman <anders.broman@ericsson.com> | 2009-10-09 07:24:33 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2009-10-09 07:24:33 +0000 |
commit | 4d2e653901ab7bb17c9ed3269a930569d8ada5eb (patch) | |
tree | 042347d5d4c01107ff02979c33de22a372f7ff69 /plugins | |
parent | 46aa5c44de5b62cc061840b29903a63bc3790445 (diff) |
From Didier Gautheron:
Dissectors using call_dissector() function inside a 'if (tree) {}' block.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4107
svn path=/trunk/; revision=30415
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/docsis/packet-dsaack.c | 10 | ||||
-rw-r--r-- | plugins/docsis/packet-dsareq.c | 8 | ||||
-rw-r--r-- | plugins/docsis/packet-dsarsp.c | 8 | ||||
-rw-r--r-- | plugins/docsis/packet-dscack.c | 8 | ||||
-rw-r--r-- | plugins/docsis/packet-dscreq.c | 8 | ||||
-rw-r--r-- | plugins/docsis/packet-dscrsp.c | 8 | ||||
-rw-r--r-- | plugins/docsis/packet-dsdreq.c | 8 | ||||
-rw-r--r-- | plugins/docsis/packet-regack.c | 8 | ||||
-rw-r--r-- | plugins/docsis/packet-regreq.c | 8 | ||||
-rw-r--r-- | plugins/docsis/packet-regreqmp.c | 8 | ||||
-rw-r--r-- | plugins/docsis/packet-regrsp.c | 8 | ||||
-rw-r--r-- | plugins/docsis/packet-regrspmp.c | 8 | ||||
-rw-r--r-- | plugins/docsis/packet-tlv.c | 1 | ||||
-rw-r--r-- | plugins/docsis/packet-uccreq.c | 8 | ||||
-rw-r--r-- | plugins/ethercat/packet-ecatmb.c | 1 | ||||
-rw-r--r-- | plugins/wimax/mac_mgmt_msg_decoder.c | 1 | ||||
-rw-r--r-- | plugins/wimaxasncp/packet-wimaxasncp.c | 1 |
17 files changed, 53 insertions, 57 deletions
diff --git a/plugins/docsis/packet-dsaack.c b/plugins/docsis/packet-dsaack.c index cabc05e1a2..098ee786ab 100644 --- a/plugins/docsis/packet-dsaack.c +++ b/plugins/docsis/packet-dsaack.c @@ -48,7 +48,7 @@ dissect_dsaack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { proto_item *it; - proto_tree *dsaack_tree; + proto_tree *dsaack_tree = NULL; guint16 transid; guint8 response; tvbuff_t *next_tvb; @@ -74,11 +74,11 @@ dissect_dsaack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) FALSE); proto_tree_add_item (dsaack_tree, hf_docsis_dsaack_response, tvb, 2, 1, FALSE); - - /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset_remaining (tvb, 3); - call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsaack_tree); } + + /* Call Dissector for Appendix C TLV's */ + next_tvb = tvb_new_subset_remaining (tvb, 3); + call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsaack_tree); } diff --git a/plugins/docsis/packet-dsareq.c b/plugins/docsis/packet-dsareq.c index e323663a1b..acdd0c5deb 100644 --- a/plugins/docsis/packet-dsareq.c +++ b/plugins/docsis/packet-dsareq.c @@ -45,7 +45,7 @@ dissect_dsareq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { proto_item *it; - proto_tree *dsareq_tree; + proto_tree *dsareq_tree = NULL; guint16 transid; tvbuff_t *next_tvb; @@ -67,10 +67,10 @@ dissect_dsareq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item (dsareq_tree, hf_docsis_dsareq_tranid, tvb, 0, 2, FALSE); - /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset_remaining (tvb, 2); - call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsareq_tree); } + /* Call Dissector for Appendix C TLV's */ + next_tvb = tvb_new_subset_remaining (tvb, 2); + call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsareq_tree); } diff --git a/plugins/docsis/packet-dsarsp.c b/plugins/docsis/packet-dsarsp.c index b2421921da..02da937aba 100644 --- a/plugins/docsis/packet-dsarsp.c +++ b/plugins/docsis/packet-dsarsp.c @@ -48,7 +48,7 @@ dissect_dsarsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { proto_item *it; - proto_tree *dsarsp_tree; + proto_tree *dsarsp_tree = NULL; guint16 transid; guint8 response; tvbuff_t *next_tvb; @@ -75,10 +75,10 @@ dissect_dsarsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item (dsarsp_tree, hf_docsis_dsarsp_response, tvb, 2, 1, FALSE); - /* Call dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset_remaining (tvb, 3); - call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsarsp_tree); } + /* Call dissector for Appendix C TLV's */ + next_tvb = tvb_new_subset_remaining (tvb, 3); + call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsarsp_tree); diff --git a/plugins/docsis/packet-dscack.c b/plugins/docsis/packet-dscack.c index 15a532fe34..884ba4a991 100644 --- a/plugins/docsis/packet-dscack.c +++ b/plugins/docsis/packet-dscack.c @@ -48,7 +48,7 @@ dissect_dscack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { proto_item *it; - proto_tree *dscack_tree; + proto_tree *dscack_tree = NULL; guint16 transid; guint8 response; tvbuff_t *next_tvb; @@ -74,10 +74,10 @@ dissect_dscack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) FALSE); proto_tree_add_item (dscack_tree, hf_docsis_dscack_response, tvb, 2, 1, FALSE); - /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset_remaining (tvb, 3); - call_dissector (docsis_tlv_handle, next_tvb, pinfo, dscack_tree); } + /* Call Dissector for Appendix C TLV's */ + next_tvb = tvb_new_subset_remaining (tvb, 3); + call_dissector (docsis_tlv_handle, next_tvb, pinfo, dscack_tree); diff --git a/plugins/docsis/packet-dscreq.c b/plugins/docsis/packet-dscreq.c index 20edeb7b17..9bbcc54b41 100644 --- a/plugins/docsis/packet-dscreq.c +++ b/plugins/docsis/packet-dscreq.c @@ -45,7 +45,7 @@ dissect_dscreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { proto_item *it; - proto_tree *dscreq_tree; + proto_tree *dscreq_tree = NULL; guint16 transid; tvbuff_t *next_tvb; @@ -68,10 +68,10 @@ dissect_dscreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item (dscreq_tree, hf_docsis_dscreq_tranid, tvb, 0, 2, FALSE); - /* Call dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset_remaining (tvb, 2); - call_dissector (docsis_tlv_handle, next_tvb, pinfo, dscreq_tree); } + /* Call dissector for Appendix C TLV's */ + next_tvb = tvb_new_subset_remaining (tvb, 2); + call_dissector (docsis_tlv_handle, next_tvb, pinfo, dscreq_tree); } diff --git a/plugins/docsis/packet-dscrsp.c b/plugins/docsis/packet-dscrsp.c index a51cceed79..5b6906620a 100644 --- a/plugins/docsis/packet-dscrsp.c +++ b/plugins/docsis/packet-dscrsp.c @@ -48,7 +48,7 @@ dissect_dscrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { proto_item *it; - proto_tree *dscrsp_tree; + proto_tree *dscrsp_tree = NULL; guint16 transid; guint8 response; tvbuff_t *next_tvb; @@ -76,10 +76,10 @@ dissect_dscrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item (dscrsp_tree, hf_docsis_dscrsp_response, tvb, 2, 1, FALSE); - /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset_remaining (tvb, 3); - call_dissector (docsis_tlv_handle, next_tvb, pinfo, dscrsp_tree); } + /* Call Dissector for Appendix C TLV's */ + next_tvb = tvb_new_subset_remaining (tvb, 3); + call_dissector (docsis_tlv_handle, next_tvb, pinfo, dscrsp_tree); } diff --git a/plugins/docsis/packet-dsdreq.c b/plugins/docsis/packet-dsdreq.c index a11e1cac41..50cb7258a7 100644 --- a/plugins/docsis/packet-dsdreq.c +++ b/plugins/docsis/packet-dsdreq.c @@ -48,7 +48,7 @@ dissect_dsdreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { proto_item *it; - proto_tree *dsdreq_tree; + proto_tree *dsdreq_tree = NULL; guint16 transid; tvbuff_t *next_tvb; @@ -73,10 +73,10 @@ dissect_dsdreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item (dsdreq_tree, hf_docsis_dsdreq_sfid, tvb, 4, 4, FALSE); - /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset_remaining (tvb, 8); - call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsdreq_tree); } + /* Call Dissector for Appendix C TLV's */ + next_tvb = tvb_new_subset_remaining (tvb, 8); + call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsdreq_tree); } diff --git a/plugins/docsis/packet-regack.c b/plugins/docsis/packet-regack.c index 84e4a7d21c..62c4b68c2f 100644 --- a/plugins/docsis/packet-regack.c +++ b/plugins/docsis/packet-regack.c @@ -48,7 +48,7 @@ dissect_regack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { proto_item *it; - proto_tree *regack_tree; + proto_tree *regack_tree = NULL; guint16 sid; guint8 response; tvbuff_t *next_tvb; @@ -74,10 +74,10 @@ dissect_regack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item (regack_tree, hf_docsis_regack_response, tvb, 2, 1, FALSE); - /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset_remaining (tvb, 3); - call_dissector (docsis_tlv_handle, next_tvb, pinfo, regack_tree); } + /* Call Dissector for Appendix C TLV's */ + next_tvb = tvb_new_subset_remaining (tvb, 3); + call_dissector (docsis_tlv_handle, next_tvb, pinfo, regack_tree); } diff --git a/plugins/docsis/packet-regreq.c b/plugins/docsis/packet-regreq.c index d3258877fc..246f385ed7 100644 --- a/plugins/docsis/packet-regreq.c +++ b/plugins/docsis/packet-regreq.c @@ -46,7 +46,7 @@ dissect_regreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { proto_item *it; - proto_tree *regreq_tree; + proto_tree *regreq_tree = NULL; guint16 sid; tvbuff_t *next_tvb; @@ -67,10 +67,10 @@ dissect_regreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) regreq_tree = proto_item_add_subtree (it, ett_docsis_regreq); proto_tree_add_item (regreq_tree, hf_docsis_regreq_sid, tvb, 0, 2, FALSE); - /* Call Dissector for Appendix C TlV's */ - next_tvb = tvb_new_subset_remaining (tvb, 2); - call_dissector (docsis_tlv_handle, next_tvb, pinfo, regreq_tree); } + /* Call Dissector for Appendix C TlV's */ + next_tvb = tvb_new_subset_remaining (tvb, 2); + call_dissector (docsis_tlv_handle, next_tvb, pinfo, regreq_tree); diff --git a/plugins/docsis/packet-regreqmp.c b/plugins/docsis/packet-regreqmp.c index d3a776a5c2..668e63dbbd 100644 --- a/plugins/docsis/packet-regreqmp.c +++ b/plugins/docsis/packet-regreqmp.c @@ -52,7 +52,7 @@ dissect_regreqmp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { proto_item *it; - proto_tree *regreqmp_tree; + proto_tree *regreqmp_tree = NULL; tvbuff_t *next_tvb; col_set_str(pinfo->cinfo, COL_INFO, "REG-REQ-MP Message:"); @@ -66,10 +66,10 @@ dissect_regreqmp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item (regreqmp_tree, hf_docsis_regreqmp_number_of_fragments, tvb, 2, 1, FALSE); proto_tree_add_item (regreqmp_tree, hf_docsis_regreqmp_fragment_sequence_number, tvb, 3, 1, FALSE); - /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset_remaining (tvb, 4); - call_dissector (docsis_tlv_handle, next_tvb, pinfo, regreqmp_tree); } + /* Call Dissector for Appendix C TLV's */ + next_tvb = tvb_new_subset_remaining (tvb, 4); + call_dissector (docsis_tlv_handle, next_tvb, pinfo, regreqmp_tree); } diff --git a/plugins/docsis/packet-regrsp.c b/plugins/docsis/packet-regrsp.c index eec7883398..e647c79816 100644 --- a/plugins/docsis/packet-regrsp.c +++ b/plugins/docsis/packet-regrsp.c @@ -49,7 +49,7 @@ dissect_regrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { proto_item *it; - proto_tree *regrsp_tree; + proto_tree *regrsp_tree = NULL; guint16 sid; guint8 response; tvbuff_t *next_tvb; @@ -75,10 +75,10 @@ dissect_regrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) FALSE); proto_tree_add_item (regrsp_tree, hf_docsis_regrsp_response, tvb, 2, 1, FALSE); - /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset_remaining (tvb, 3); - call_dissector (docsis_tlv_handle, next_tvb, pinfo, regrsp_tree); } + /* Call Dissector for Appendix C TLV's */ + next_tvb = tvb_new_subset_remaining (tvb, 3); + call_dissector (docsis_tlv_handle, next_tvb, pinfo, regrsp_tree); } diff --git a/plugins/docsis/packet-regrspmp.c b/plugins/docsis/packet-regrspmp.c index 92975ccfd2..5c976d9b06 100644 --- a/plugins/docsis/packet-regrspmp.c +++ b/plugins/docsis/packet-regrspmp.c @@ -54,7 +54,7 @@ static void dissect_regrspmp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { proto_item *it; - proto_tree *regrspmp_tree; + proto_tree *regrspmp_tree = NULL; tvbuff_t *next_tvb; @@ -72,10 +72,10 @@ dissect_regrspmp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item (regrspmp_tree, hf_docsis_regrspmp_number_of_fragments, tvb, 3, 1, FALSE); proto_tree_add_item (regrspmp_tree, hf_docsis_regrspmp_fragment_sequence_number, tvb, 4, 1, FALSE); - /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset_remaining (tvb, 5); - call_dissector (docsis_tlv_handle, next_tvb, pinfo, regrspmp_tree); } + /* Call Dissector for Appendix C TLV's */ + next_tvb = tvb_new_subset_remaining (tvb, 5); + call_dissector (docsis_tlv_handle, next_tvb, pinfo, regrspmp_tree); } diff --git a/plugins/docsis/packet-tlv.c b/plugins/docsis/packet-tlv.c index bd0b392d34..e7e16a9c0a 100644 --- a/plugins/docsis/packet-tlv.c +++ b/plugins/docsis/packet-tlv.c @@ -1780,7 +1780,6 @@ dissect_tlv (tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree) total_len = tvb_reported_length_remaining (tvb, 0); - if (tree) { it = proto_tree_add_protocol_format (tree, proto_docsis_tlv, tvb, 0, diff --git a/plugins/docsis/packet-uccreq.c b/plugins/docsis/packet-uccreq.c index adb61f5708..ba5aa25384 100644 --- a/plugins/docsis/packet-uccreq.c +++ b/plugins/docsis/packet-uccreq.c @@ -45,7 +45,7 @@ dissect_uccreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { proto_item *it; - proto_tree *uccreq_tree; + proto_tree *uccreq_tree = NULL; guint8 chid; tvbuff_t *next_tvb; @@ -68,10 +68,10 @@ dissect_uccreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item (uccreq_tree, hf_docsis_uccreq_upchid, tvb, 0, 1, FALSE); - /* call dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset_remaining (tvb, 1); - call_dissector (docsis_tlv_handle, next_tvb, pinfo, uccreq_tree); } + /* call dissector for Appendix C TLV's */ + next_tvb = tvb_new_subset_remaining (tvb, 1); + call_dissector (docsis_tlv_handle, next_tvb, pinfo, uccreq_tree); } diff --git a/plugins/ethercat/packet-ecatmb.c b/plugins/ethercat/packet-ecatmb.c index 13dc5072eb..37b549c30a 100644 --- a/plugins/ethercat/packet-ecatmb.c +++ b/plugins/ethercat/packet-ecatmb.c @@ -1043,7 +1043,6 @@ static void dissect_ecat_eoe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro col_append_str(pinfo->cinfo, COL_INFO, szText); } - if( tree ) { ecat_eoe_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_eoe); diff --git a/plugins/wimax/mac_mgmt_msg_decoder.c b/plugins/wimax/mac_mgmt_msg_decoder.c index f1dcaebe6e..27b1134de2 100644 --- a/plugins/wimax/mac_mgmt_msg_decoder.c +++ b/plugins/wimax/mac_mgmt_msg_decoder.c @@ -195,7 +195,6 @@ void dissect_mac_mgmt_msg_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree proto_item *message_item = NULL; proto_tree *message_tree = NULL; - if (tree) { /* we are being asked for details */ /* Get the tvb reported length */ tvb_len = tvb_reported_length(tvb); diff --git a/plugins/wimaxasncp/packet-wimaxasncp.c b/plugins/wimaxasncp/packet-wimaxasncp.c index 135d5877d1..dbb0466995 100644 --- a/plugins/wimaxasncp/packet-wimaxasncp.c +++ b/plugins/wimaxasncp/packet-wimaxasncp.c @@ -1474,7 +1474,6 @@ static void wimaxasncp_dissect_tlv_value( } - if (tree) { proto_tree *eap_tree; proto_item *item; |