From Didier Gautheron:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 9 Oct 2009 07:24:33 +0000 (07:24 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 9 Oct 2009 07:24:33 +0000 (07:24 +0000)
Dissectors using call_dissector() function inside a 'if (tree) {}' block.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4107

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30415 f5534014-38df-0310-8fa8-9805f1628bb7

35 files changed:
epan/dissectors/packet-artnet.c
epan/dissectors/packet-cisco-erspan.c
epan/dissectors/packet-clnp.c
epan/dissectors/packet-ehs.c
epan/dissectors/packet-eigrp.c
epan/dissectors/packet-icmpv6.c
epan/dissectors/packet-ipdc.c
epan/dissectors/packet-jabber.c
epan/dissectors/packet-jxta.c
epan/dissectors/packet-l2tp.c
epan/dissectors/packet-mip.c
epan/dissectors/packet-pim.c
epan/dissectors/packet-pop.c
epan/dissectors/packet-pw-cesopsn.c
epan/dissectors/packet-stun.c
epan/dissectors/packet-turbocell.c
epan/dissectors/packet-turnchannel.c
epan/dissectors/packet-vcdu.c
plugins/docsis/packet-dsaack.c
plugins/docsis/packet-dsareq.c
plugins/docsis/packet-dsarsp.c
plugins/docsis/packet-dscack.c
plugins/docsis/packet-dscreq.c
plugins/docsis/packet-dscrsp.c
plugins/docsis/packet-dsdreq.c
plugins/docsis/packet-regack.c
plugins/docsis/packet-regreq.c
plugins/docsis/packet-regreqmp.c
plugins/docsis/packet-regrsp.c
plugins/docsis/packet-regrspmp.c
plugins/docsis/packet-tlv.c
plugins/docsis/packet-uccreq.c
plugins/ethercat/packet-ecatmb.c
plugins/wimax/mac_mgmt_msg_decoder.c
plugins/wimaxasncp/packet-wimaxasncp.c

index 4ebafc64257cd2533e91e83bdd4229e815363401..b8af3bc758849895d8ba6be2db4e03e290317d00 100644 (file)
@@ -1651,20 +1651,18 @@ dissect_artnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
       break;
 
     case ARTNET_OP_RDM:
-      if (tree) {
-       hi = proto_tree_add_item(artnet_tree,
+      hi = proto_tree_add_item(artnet_tree,
                                 hf_artnet_rdm,
                                 tvb,
                                 offset,
                                 0,
                                 FALSE);
-       si = proto_item_add_subtree(hi,ett_artnet);
+      si = proto_item_add_subtree(hi,ett_artnet);
 
-       size = dissect_artnet_rdm( tvb, offset, si, pinfo );
-       size -= offset;
+      size = dissect_artnet_rdm( tvb, offset, si, pinfo );
+      size -= offset;
 
-       proto_item_set_len( si, size );
-      }
+      proto_item_set_len( si, size );
       break;
 
     case ARTNET_OP_IP_PROG:
index ce940770e130f186eac6070dfbd33319b79661b2..4cc00f45563d075eb2d036060dbde465fa510902 100644 (file)
@@ -128,10 +128,13 @@ dissect_erspan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                proto_tree_add_item(erspan_tree, hf_erspan_unknown4, tvb, offset, 4,
                        FALSE);
                offset += 4;
-
-               eth_tvb = tvb_new_subset_remaining(tvb, offset);
-               call_dissector(ethnofcs_handle, eth_tvb, pinfo, tree);
        }
+       else {
+               offset += 8;
+       }
+
+        eth_tvb = tvb_new_subset_remaining(tvb, offset);
+        call_dissector(ethnofcs_handle, eth_tvb, pinfo, tree);
 }
 
 void
index 913be638f3085901b69b8659b2e5379f529bc07d..04c904b878f4bb7dc19922f2ba7facb7094abcea 100644 (file)
@@ -511,9 +511,8 @@ static void dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         dissect it as a CLNP PDU. */
       if (check_col(pinfo->cinfo, COL_INFO))
         col_add_fstr(pinfo->cinfo, COL_INFO, "%s NPDU %s", pdu_type_string, flag_string);
-      if (tree) {
-        next_length = tvb_length_remaining(tvb, offset);
-        if (next_length != 0) {
+      next_length = tvb_length_remaining(tvb, offset);
+      if (next_length != 0) {
           /* We have payload; dissect it. */
           ti = proto_tree_add_text(clnp_tree, tvb, offset, next_length,
             "Discarded PDU");
@@ -530,7 +529,6 @@ static void dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
           /* Restore the "we're inside an error packet" flag. */
           pinfo->in_error_pkt = save_in_error_pkt;
-        }
       }
       pinfo->fragmented = save_fragmented;
       return;  /* we're done with this PDU */
index e15fb90d2334ce07950b7d239df48f04ed7b3fda..009660ede1c9c241b44097355682efc1de1a0270 100644 (file)
@@ -1066,113 +1066,110 @@ dissect_ehs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         col_set_str(pinfo->cinfo, COL_PROTOCOL, "EHS");
         col_set_str(pinfo->cinfo, COL_INFO, "EHS");
 
-       if ( tree )
+        ehs_packet = proto_tree_add_item ( tree, proto_ehs, tvb, 0, -1, FALSE );
+        ehs_tree = proto_item_add_subtree ( ehs_packet, ett_ehs );
+
+        /* build the ehs primary header tree */
+        ehs_primary_header = proto_tree_add_text ( ehs_tree, tvb, offset, EHS_PRIMARY_HEADER_SIZE, "Primary EHS Header" );
+        ehs_primary_header_tree = proto_item_add_subtree ( ehs_primary_header, ett_ehs_primary_header );
+
+        proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_version, tvb, offset, 1, FALSE );
+        proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_project, tvb, offset, 1, FALSE );
+        ++offset;
+
+        proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_support_mode, tvb, offset, 1, FALSE );
+        proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_data_mode, tvb, offset, 1, FALSE );
+        ++offset;
+
+        proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_mission, tvb, offset, 1, FALSE );
+        ++offset;
+
+        /* save protocol for use later on */
+        protocol = tvb_get_guint8 ( tvb, offset );
+        proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_protocol, tvb, offset, 1, FALSE );
+        ++offset;
+
+        year = tvb_get_guint8 ( tvb, offset );
+        proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_year, tvb, offset, 1, FALSE );
+        ++offset;
+
+        jday = tvb_get_ntohs ( tvb, offset );
+        proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_jday, tvb, offset, 2, FALSE );
+        offset += 2;
+
+        hour = tvb_get_guint8 ( tvb, offset );
+        proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_hour, tvb, offset, 1, FALSE );
+        ++offset;
+
+        minute = tvb_get_guint8 ( tvb, offset );
+        proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_minute, tvb, offset, 1, FALSE );
+        ++offset;
+
+        second = tvb_get_guint8 ( tvb, offset );
+        proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_second, tvb, offset, 1, FALSE );
+        ++offset;
+
+        tenths = tvb_get_guint8 ( tvb, offset ) >> 4;
+        proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_tenths, tvb, offset, 1, FALSE );
+
+        /* format a more readable ground receipt time string */
+        proto_tree_add_text ( ehs_primary_header_tree, tvb, offset-7, 7,
+          "%04d/%03d:%02d:%02d:%02d.%1d = EHS Ground Receipt Time", year + 1900, jday, hour, minute, second, tenths );
+
+        proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_new_data_flag, tvb, offset, 1, FALSE );
+        /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad1, tvb, offset, 1, FALSE ); */
+        proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_hold_flag, tvb, offset, 1, FALSE );
+        proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_sign_flag, tvb, offset, 1, FALSE );
+        ++offset;
+
+        /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad2, tvb, offset, 1, FALSE ); */
+        ++offset;
+        /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad3, tvb, offset, 1, FALSE ); */
+        ++offset;
+        /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad4, tvb, offset, 1, FALSE ); */
+        ++offset;
+
+        proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_hosc_packet_size, tvb, offset, 2, FALSE );
+        offset += 2;
+
+        /* build the ehs secondary header tree */
+        ehs_secondary_header = proto_tree_add_text ( ehs_tree, tvb, offset,
+          ehs_secondary_header_size ( protocol, tvb, offset ), "Secondary EHS Header" );
+        ehs_secondary_header_tree = proto_item_add_subtree ( ehs_secondary_header, ett_ehs_secondary_header );
+
+        /* since each protocol can have a different ehs secondary header structure, we will offload
+         * this processing to lower levels of code so we don't have to insert all of that complexity
+         * directly inline here, which would no doubt make this difficult to read at best.
+         */
+        ehs_secondary_header_dissector ( protocol, ehs_secondary_header_tree, tvb, &offset );
+
+        /* for ccsds protocol types pass the remaining packet off to the ccsds packet dissector */
+        switch ( protocol )
         {
-                ehs_packet = proto_tree_add_item ( tree, proto_ehs, tvb, 0, -1, FALSE );
-                ehs_tree = proto_item_add_subtree ( ehs_packet, ett_ehs );
-
-                /* build the ehs primary header tree */
-                ehs_primary_header = proto_tree_add_text ( ehs_tree, tvb, offset, EHS_PRIMARY_HEADER_SIZE, "Primary EHS Header" );
-                ehs_primary_header_tree = proto_item_add_subtree ( ehs_primary_header, ett_ehs_primary_header );
-
-                proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_version, tvb, offset, 1, FALSE );
-                proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_project, tvb, offset, 1, FALSE );
-                ++offset;
-
-                proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_support_mode, tvb, offset, 1, FALSE );
-                proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_data_mode, tvb, offset, 1, FALSE );
-                ++offset;
-
-                proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_mission, tvb, offset, 1, FALSE );
-                ++offset;
-
-                /* save protocol for use later on */
-                protocol = tvb_get_guint8 ( tvb, offset );
-                proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_protocol, tvb, offset, 1, FALSE );
-                ++offset;
-
-                year = tvb_get_guint8 ( tvb, offset );
-                proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_year, tvb, offset, 1, FALSE );
-                ++offset;
-
-                jday = tvb_get_ntohs ( tvb, offset );
-                proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_jday, tvb, offset, 2, FALSE );
-                offset += 2;
-
-                hour = tvb_get_guint8 ( tvb, offset );
-                proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_hour, tvb, offset, 1, FALSE );
-                ++offset;
-
-                minute = tvb_get_guint8 ( tvb, offset );
-                proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_minute, tvb, offset, 1, FALSE );
-                ++offset;
-
-                second = tvb_get_guint8 ( tvb, offset );
-                proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_second, tvb, offset, 1, FALSE );
-                ++offset;
-
-                tenths = tvb_get_guint8 ( tvb, offset ) >> 4;
-                proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_tenths, tvb, offset, 1, FALSE );
-
-                /* format a more readable ground receipt time string */
-                proto_tree_add_text ( ehs_primary_header_tree, tvb, offset-7, 7,
-                  "%04d/%03d:%02d:%02d:%02d.%1d = EHS Ground Receipt Time", year + 1900, jday, hour, minute, second, tenths );
-
-                proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_new_data_flag, tvb, offset, 1, FALSE );
-                /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad1, tvb, offset, 1, FALSE ); */
-                proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_hold_flag, tvb, offset, 1, FALSE );
-                proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_sign_flag, tvb, offset, 1, FALSE );
-                ++offset;
-
-                /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad2, tvb, offset, 1, FALSE ); */
-                ++offset;
-                /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad3, tvb, offset, 1, FALSE ); */
-                ++offset;
-                /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad4, tvb, offset, 1, FALSE ); */
-                ++offset;
-
-                proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_hosc_packet_size, tvb, offset, 2, FALSE );
-                offset += 2;
-
-                /* build the ehs secondary header tree */
-                ehs_secondary_header = proto_tree_add_text ( ehs_tree, tvb, offset,
-                  ehs_secondary_header_size ( protocol, tvb, offset ), "Secondary EHS Header" );
-                ehs_secondary_header_tree = proto_item_add_subtree ( ehs_secondary_header, ett_ehs_secondary_header );
-
-                /* since each protocol can have a different ehs secondary header structure, we will offload
-                 * this processing to lower levels of code so we don't have to insert all of that complexity
-                 * directly inline here, which would no doubt make this difficult to read at best.
-                 */
-                ehs_secondary_header_dissector ( protocol, ehs_secondary_header_tree, tvb, &offset );
-
-                /* for ccsds protocol types pass the remaining packet off to the ccsds packet dissector */
-                switch ( protocol )
-                {
-                case EHS_PROTOCOL__TDM_TELEMETRY:
-                case EHS_PROTOCOL__PSEUDO_TELEMETRY:
-                case EHS_PROTOCOL__AOS_LOS:
-                case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET:
-                case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET:
-                case EHS_PROTOCOL__PDSS_UDSM:
-                        new_tvb = tvb_new_subset_remaining ( tvb, offset);
-                        call_dissector ( ccsds_handle, new_tvb, pinfo, ehs_tree );
-
-                        /* bump the offset to the data zone area */
-                       first_word = tvb_get_ntohs ( tvb, offset );
-
-                        offset += CCSDS_PRIMARY_HEADER_LENGTH;
-                       if ( first_word & HDR_SECHDR ) offset += CCSDS_SECONDARY_HEADER_LENGTH;
-                        break;
-
-
-                default:
-                        break;
-                }
-
-                /* build the ehs data zone tree for well known protocols such as AOS/LOS and UDSM */
-                ehs_data_zone_dissector ( protocol, ehs_tree, tvb, &offset, pinfo );
+        case EHS_PROTOCOL__TDM_TELEMETRY:
+        case EHS_PROTOCOL__PSEUDO_TELEMETRY:
+        case EHS_PROTOCOL__AOS_LOS:
+        case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET:
+        case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET:
+        case EHS_PROTOCOL__PDSS_UDSM:
+                new_tvb = tvb_new_subset_remaining ( tvb, offset);
+                call_dissector ( ccsds_handle, new_tvb, pinfo, ehs_tree );
+
+                /* bump the offset to the data zone area */
+               first_word = tvb_get_ntohs ( tvb, offset );
+
+                offset += CCSDS_PRIMARY_HEADER_LENGTH;
+               if ( first_word & HDR_SECHDR ) offset += CCSDS_SECONDARY_HEADER_LENGTH;
+                break;
+
+
+        default:
+                break;
         }
 
+        /* build the ehs data zone tree for well known protocols such as AOS/LOS and UDSM */
+        ehs_data_zone_dissector ( protocol, ehs_tree, tvb, &offset, pinfo );
+
 }
 
 
index 917793df227af55eaadb0b88f2481f070896e7ba..40270e0a8f2a9723a1a25c4066a84e904ce77d0e 100644 (file)
@@ -352,7 +352,7 @@ static void dissect_eigrp_ip6_ext(tvbuff_t *tvb, proto_tree *tree, proto_item *t
 
 static void dissect_eigrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
 
-       proto_tree *eigrp_tree, *tlv_tree, *eigrp_flags_tree;
+       proto_tree *eigrp_tree = NULL, *tlv_tree, *eigrp_flags_tree;
        proto_item *ti;
 
        guint opcode, opcode_tmp;
@@ -378,7 +378,6 @@ static void dissect_eigrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
                proto_tree_add_item(eigrp_tree, hf_eigrp_version, tvb, 0, 1, FALSE);
                proto_tree_add_item(eigrp_tree, hf_eigrp_opcode, tvb, 1, 1, FALSE);
                proto_tree_add_item(eigrp_tree, hf_eigrp_checksum, tvb, 2, 2, FALSE);
-
 /* Decode the EIGRP Flags Field */
 
                ti = proto_tree_add_item(eigrp_tree, hf_eigrp_flags, tvb, 4, 4, FALSE);
@@ -392,12 +391,14 @@ static void dissect_eigrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
                proto_tree_add_item(eigrp_tree, hf_eigrp_sequence, tvb, 8, 4, FALSE);
                proto_tree_add_item(eigrp_tree, hf_eigrp_acknowledge, tvb, 12, 4, FALSE);
                proto_tree_add_item(eigrp_tree, hf_eigrp_as, tvb, 16, 4, FALSE);
+       }
 
-               if (opcode == EIGRP_SAP) {
-                       call_dissector(ipxsap_handle, tvb_new_subset(tvb, EIGRP_HEADER_LENGTH, -1, -1), pinfo, eigrp_tree);
-                       return;
-               }
+       if (opcode == EIGRP_SAP) {
+               call_dissector(ipxsap_handle, tvb_new_subset(tvb, EIGRP_HEADER_LENGTH, -1, -1), pinfo, eigrp_tree);
+               return;
+       }
 
+       if (tree) {
                while (tvb_reported_length_remaining(tvb, offset) > 0) {
 
                        tlv = tvb_get_ntohs(tvb, offset);
index d56c17e8237c5376445c0fde0c3861cc29ae020c..84d94346e8a086e8de05c36bd7973411ef3b11b3 100644 (file)
@@ -363,9 +363,6 @@ dissect_icmpv6ndopt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t
     guint32 no_of_pars;
     guint32 i;
 
-    if (!tree)
-        return;
-
 again:
     if ((int)tvb_reported_length(tvb) <= offset)
         return; /* No more options left */
index 2106400e8f828dd0531180423eff2c9b56b2e2f0..78cd3cba8bc35983a963378915818ddc2d98b3fc 100644 (file)
@@ -148,8 +148,6 @@ dissect_ipdc_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                         val_to_str(message_code, message_code_vals,
                         TEXT_UNDEFINED));
 
-       if (!tree)
-               return;
 
        ti = proto_tree_add_item(tree, proto_ipdc, tvb, 0, -1, FALSE);
        ipdc_tree = proto_item_add_subtree(ti, ett_ipdc);
index da71c1e4bc0f707280cc236b947129728bd584b4..57a461c60103d5cffdb878388bce4ce97828eca6 100644 (file)
@@ -52,7 +52,7 @@ static void
 dissect_jabber(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
         gboolean        is_request;
-        proto_tree      *jabber_tree;
+        proto_tree      *jabber_tree = NULL;
         proto_item      *ti, *hidden_item;
        gint            offset = 0;
        const guchar    *line;
@@ -100,10 +100,10 @@ dissect_jabber(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                            hf_jabber_response, tvb, 0, 0, TRUE);
                }
                PROTO_ITEM_SET_HIDDEN(hidden_item);
-
-               xmltvb = tvb_new_subset_remaining(tvb, offset);
-               call_dissector(xml_handle, xmltvb, pinfo, jabber_tree);
        }
+
+        xmltvb = tvb_new_subset_remaining(tvb, offset);
+        call_dissector(xml_handle, xmltvb, pinfo, jabber_tree);
 }
 
 void
index 1d395c02683283d7a57801e44eed7034311cf46d..f40dec4846990dc40daab44a5ff8c7327d7caff4 100644 (file)
@@ -477,7 +477,7 @@ static int dissect_jxta_udp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr
 
     col_set_str(pinfo->cinfo, COL_PROTOCOL, "JXTA");
 
-    if (tree) {
+    {
         guint tree_offset = 0;
         proto_item *jxta_tree_item =
             proto_tree_add_protocol_format(tree, proto_jxta, tvb, offset, -1, "JXTA" );
@@ -1609,7 +1609,7 @@ static int dissect_jxta_message_element_1(tvbuff_t * tvb, packet_info * pinfo, p
     }
 
     /* Second (optional) pass : build the proto tree */
-    if (tree) {
+    {
         guint tree_offset = 0;
         proto_item *jxta_elem_tree_item = proto_tree_add_item(tree, hf_jxta_element, tvb, tree_offset, -1, FALSE);
         proto_tree *jxta_elem_tree = proto_item_add_subtree(jxta_elem_tree_item, ett_jxta_elem);
@@ -1867,7 +1867,7 @@ static int dissect_jxta_message_element_2(tvbuff_t * tvb, packet_info * pinfo, p
     }
 
     /* Second (optional) pass : build the proto tree */
-    if (tree) {
+    {
         guint tree_offset = 0;
         proto_item *jxta_elem_tree_item = proto_tree_add_item(tree, hf_jxta_element, tvb, tree_offset, -1, FALSE);
         proto_tree *jxta_elem_tree = proto_item_add_subtree(jxta_elem_tree_item, ett_jxta_elem);
index 48014513f115b8768d8b66e288fdc2953b86d395..c5d0973cb57751bde605bdd179f114e0b4db4beb 100644 (file)
@@ -601,7 +601,6 @@ static void process_control_avps(tvbuff_t *tvb,
        guint32         bits;
        guint16         firmware_rev;
        
-       if (l2tp_tree) {
                while (index < length) {    /* Process AVP's */
                        ver_len_hidden  = tvb_get_ntohs(tvb, index);
                        avp_len         = AVP_LENGTH(ver_len_hidden);
@@ -1345,7 +1344,6 @@ static void process_control_avps(tvbuff_t *tvb,
                        index += avp_len;
                }
 
-       }
 }
 
 /*
index ca1d61487b4bb224d2b755b33287ab3f33c2dba8..b30a090ff86dcb7bee4729fb1ccc31e1ad5c23d0 100644 (file)
@@ -696,12 +696,14 @@ dissect_mip( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
          /* reserved */
          proto_tree_add_item(mip_tree, hf_mip_nattt_reserved, tvb, offset, 2, FALSE);
          offset += 2;
-
-         /* encapsulated payload */
-         next_tvb = tvb_new_subset_remaining(tvb, 4);
-         call_dissector(ip_handle, next_tvb, pinfo, mip_tree);
-         offset += tvb_reported_length_remaining(tvb, offset);
        } /* if tree */
+       else {
+         offset += 4;
+       }
+       /* encapsulated payload */
+       next_tvb = tvb_new_subset_remaining(tvb, 4);
+       call_dissector(ip_handle, next_tvb, pinfo, mip_tree);
+       offset += tvb_reported_length_remaining(tvb, offset);
        break;
   case REGISTRATION_REVOCATION:
        if (check_col(pinfo->cinfo, COL_INFO))
index 754f31a0f8dedf01198090be2f7a128590f85b05..89346d97bdfb18e97de3fb8d412d591fc6fea639 100644 (file)
@@ -208,7 +208,6 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
 
     offset += 3;       /* skip reserved stuff */
 
-    if (tree) {
        if (tvb_reported_length_remaining(tvb, offset) > 0) {
            tiopt = proto_tree_add_text(pim_tree, tvb, offset, -1,
                    "PIM parameters");
@@ -469,7 +468,6 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
        default:
            break;
        }
-    }
 done:;
 
     return offset+tvb_length_remaining(tvb, offset);
index 4f766fcdc3c3239e3df95ddb97666b3302b622d4..926e68641cd3414bdf97d5264c2a81d51d339b23 100644 (file)
@@ -201,115 +201,116 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                    format_text(line, linelen));
   }
 
-  if (tree) { 
-    ti = proto_tree_add_item(tree, proto_pop, tvb, offset, -1, FALSE);
-    pop_tree = proto_item_add_subtree(ti, ett_pop);
+  ti = proto_tree_add_item(tree, proto_pop, tvb, offset, -1, FALSE);
+  pop_tree = proto_item_add_subtree(ti, ett_pop);
 
-    if (is_continuation) {
+  if (is_continuation) {
 
-      if (pop_data_desegment) {
+    if (pop_data_desegment) {
 
-        if (!frame_data) {
+      if (!frame_data) {
 
-          data_val->msg_read_len += tvb_length(tvb);
+        data_val->msg_read_len += tvb_length(tvb);
 
-          frame_data = se_alloc(sizeof(struct pop_proto_data));
+        frame_data = se_alloc(sizeof(struct pop_proto_data));
 
-          frame_data->conversation_id = conversation->index;
-          frame_data->more_frags = data_val->msg_read_len < data_val->msg_tot_len;
+        frame_data->conversation_id = conversation->index;
+        frame_data->more_frags = data_val->msg_read_len < data_val->msg_tot_len;
 
-          p_add_proto_data(pinfo->fd, proto_pop, frame_data);  
-        }
+        p_add_proto_data(pinfo->fd, proto_pop, frame_data);  
+      }
 
-        frag_msg = fragment_add_seq_next(tvb, 0, pinfo, 
-                                         frame_data->conversation_id, 
-                                         pop_data_segment_table, 
-                                         pop_data_reassembled_table, 
-                                         tvb_length(tvb), 
-                                         frame_data->more_frags);
+      frag_msg = fragment_add_seq_next(tvb, 0, pinfo, 
+                                       frame_data->conversation_id, 
+                                       pop_data_segment_table, 
+                                       pop_data_reassembled_table, 
+                                       tvb_length(tvb), 
+                                       frame_data->more_frags);
 
-        next_tvb = process_reassembled_data(tvb, offset, pinfo, 
-                                            "Reassembled DATA",
-                                            frag_msg, &pop_data_frag_items, 
-                                            NULL, pop_tree);
+      next_tvb = process_reassembled_data(tvb, offset, pinfo, 
+                                          "Reassembled DATA",
+                                          frag_msg, &pop_data_frag_items, 
+                                          NULL, pop_tree);
 
-        if (next_tvb) {
+      if (next_tvb) {
 
-          if (imf_handle)
-            call_dissector(imf_handle, next_tvb, pinfo, tree);
+        if (imf_handle)
+          call_dissector(imf_handle, next_tvb, pinfo, tree);
 
-          if (data_val) {
-            /* we have read everything - reset */
-            
-            data_val->msg_read_len = 0;
-            data_val->msg_tot_len = 0; 
-          }
-          pinfo->fragmented = FALSE;
-        } else {
-          pinfo->fragmented = TRUE;
+        if (data_val) {
+          /* we have read everything - reset */
+          
+          data_val->msg_read_len = 0;
+          data_val->msg_tot_len = 0; 
         }
-
+        pinfo->fragmented = FALSE;
       } else {
-
-        /*
-         * Put the whole packet into the tree as data.
-         */
-        call_dissector(data_handle,tvb, pinfo, pop_tree);
-      
+        pinfo->fragmented = TRUE;
       }
-      return;
+
+    } else {
+
+      /*
+       * Put the whole packet into the tree as data.
+       */
+      call_dissector(data_handle,tvb, pinfo, pop_tree);
+    
     }
+    return;
+  }
 
-    /*
-     * Put the line into the protocol tree.
-     */
-    ti = proto_tree_add_string_format(pop_tree,
-                                      (is_request) ?
-                                          hf_pop_request :
-                                          hf_pop_response,
-                                      tvb, offset,
-                                      next_offset - offset,
-                                      "", "%s",
-                                      tvb_format_text(tvb, offset, next_offset - offset));
-    reqresp_tree = proto_item_add_subtree(ti, ett_pop_reqresp);
+  /*
+   * Put the line into the protocol tree.
+   */
+  ti = proto_tree_add_string_format(pop_tree,
+                                    (is_request) ?
+                                        hf_pop_request :
+                                        hf_pop_response,
+                                    tvb, offset,
+                                    next_offset - offset,
+                                    "", "%s",
+                                    tvb_format_text(tvb, offset, next_offset - offset));
+  reqresp_tree = proto_item_add_subtree(ti, ett_pop_reqresp);
 
-    /*
-     * Extract the first token, and, if there is a first
-     * token, add it as the request or reply code.
-     */
-    tokenlen = get_token_len(line, line + linelen, &next_token);
-    if (tokenlen != 0) {
-      proto_tree_add_item(reqresp_tree,
-                          (is_request) ?
-                              hf_pop_request_command :
-                              hf_pop_response_indicator,
-                          tvb, offset, tokenlen, FALSE);
-
-      if (data_val) {
-        if (is_request) {
-          /* see if this is RETR or TOP command */
-          if (g_ascii_strncasecmp(line, "RETR", 4) == 0 ||
-             g_ascii_strncasecmp(line, "TOP", 3) == 0)
-            /* the next response will tell us how many bytes */
-            data_val->msg_request = TRUE;
-        } else {
-          if (data_val->msg_request) {
-            /* this is a response to a RETR or TOP command */
-
-            if (g_ascii_strncasecmp(line, "+OK ", 4) == 0) {
-              /* the message will be sent - work out how many bytes */
-              data_val->msg_read_len = 0;
-              data_val->msg_tot_len = atoi(line + 4);
-            }
-            data_val->msg_request = FALSE;
+  /*
+   * Extract the first token, and, if there is a first
+   * token, add it as the request or reply code.
+   */
+  tokenlen = get_token_len(line, line + linelen, &next_token);
+  if (tokenlen != 0) {
+    proto_tree_add_item(reqresp_tree,
+                        (is_request) ?
+                            hf_pop_request_command :
+                            hf_pop_response_indicator,
+                        tvb, offset, tokenlen, FALSE);
+
+    if (data_val) {
+      if (is_request) {
+        /* see if this is RETR or TOP command */
+        if (g_ascii_strncasecmp(line, "RETR", 4) == 0 ||
+           g_ascii_strncasecmp(line, "TOP", 3) == 0)
+          /* the next response will tell us how many bytes */
+          data_val->msg_request = TRUE;
+      } else {
+        if (data_val->msg_request) {
+          /* this is a response to a RETR or TOP command */
+
+          if (g_ascii_strncasecmp(line, "+OK ", 4) == 0) {
+            /* the message will be sent - work out how many bytes */
+            data_val->msg_read_len = 0;
+            data_val->msg_tot_len = atoi(line + 4);
           }
+          data_val->msg_request = FALSE;
         }
       }
-
-      offset += (gint) (next_token - line);
-      linelen -= (int) (next_token - line);
     }
 
+    offset += (gint) (next_token - line);
+    linelen -= (int) (next_token - line);
+  }
+
+
+  if (tree) { 
     /*
      * Add the rest of the first line as request or
      * reply param/description.
index 9b3fe549d2100cdb043b2837c9fb0e628313c3ef..20e5eca8f5eb7c9cb586a79956e9f7ed655826e8 100644 (file)
@@ -259,7 +259,6 @@ void dissect_pw_cesopsn( tvbuff_t * tvb_original
                }
        }
 
-       if (tree)
        {
                proto_item* item;
                item = proto_tree_add_item(tree, proto, tvb_original, 0, -1, FALSE);
index 5fc777360f1fc57bd0f36ffb6f66af371780283a..f5c4232bcbb82a48dba70ef15d2413d1bf8dc26c 100644 (file)
@@ -566,9 +566,6 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                             msg_method_str, msg_class_str);
        }
 
-       if (!tree)
-               return tvb_length(tvb);
-
        ti = proto_tree_add_item(tree, proto_stun, tvb, 0, -1, FALSE);
 
        stun_tree = proto_item_add_subtree(ti, ett_stun);
index f18fa1f9ab8e50b9768f3ad37d8c73af349dfe49..7c5f3f955e5bf167537651a6dbc6e0d7963e5d3e 100644 (file)
@@ -122,12 +122,13 @@ static void dissect_turbocell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
 {
 
     proto_item *ti, *name_item;
-    proto_tree *turbocell_tree, *network_tree;
+    proto_tree *turbocell_tree = NULL, *network_tree;
     tvbuff_t   *next_tvb;
     int i=0;
     guint8 packet_type;
     guint8 * str_name;
     guint str_len;
+    gint remaining_length;
 
     packet_type = tvb_get_guint8(tvb, 0);
 
@@ -146,7 +147,6 @@ static void dissect_turbocell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
     }
 
     if (tree) {
-        gint remaining_length;
         ti = proto_tree_add_item(tree, proto_turbocell, tvb, 0, 20, FALSE);
 
         turbocell_tree = proto_item_add_subtree(ti, ett_turbocell);
@@ -171,6 +171,7 @@ static void dissect_turbocell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
         proto_tree_add_item(turbocell_tree, hf_turbocell_unknown, tvb, 0x0E, 2, FALSE);
         proto_tree_add_item(turbocell_tree, hf_turbocell_ip, tvb, 0x10, 4, FALSE);
 
+    }
 
         remaining_length=tvb_length_remaining(tvb, 0x14);
 
@@ -245,7 +246,6 @@ static void dissect_turbocell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
                 }
             }
         }
-    }
 }
 
 /* Register the protocol with Wireshark */
index b710536f115bc3210c353948a2be6e66fd89a195..81f971a56ed16ef4188594228231e913aadd63cf 100644 (file)
@@ -95,9 +95,6 @@ dissect_turnchannel_message(tvbuff_t *tvb, packet_info *pinfo,
        if (check_col(pinfo->cinfo, COL_INFO))
          col_add_fstr(pinfo->cinfo, COL_INFO, "Channel Id 0x%x", channel_id);
 
-       if (!tree)
-         return tvb_length(tvb);
-
        ti = proto_tree_add_item(tree, proto_turnchannel, tvb, 0, -1, FALSE);
 
        turnchannel_tree = proto_item_add_subtree(ti, ett_turnchannel);
index 0f3db99d5115b5ca48dd95153defda601871833f..146981f0dcd018e5ad507537428652c65df4b6f4 100644 (file)
@@ -299,7 +299,7 @@ dissect_vcdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        col_set_str(pinfo->cinfo, COL_PROTOCOL, "VCDU");
        col_set_str(pinfo->cinfo, COL_INFO, "Virtual Channel Data Unit");
 
-       if (tree) {
+       {
                 /* build the smex header tree */
                smex_header=proto_tree_add_text(tree, tvb, offset, SMEX_HEADER_LENGTH, "SMEX Header");
                smex_tree=proto_item_add_subtree(smex_header, ett_smex);
index cabc05e1a225ac316540016c2b6821d15e314d52..098ee786abc2fe42ca1dce214b243264ad6efad9 100644 (file)
@@ -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);
 }
 
 
index e323663a1b79540b6bca408a6613c156ed959096..acdd0c5deb240c26815be370ad285b688f1f5735 100644 (file)
@@ -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);
 
 }
 
index b2421921dae083b1a653bbfd2d94a52e10dc5f24..02da937aba65822958bea516417ec699eafd7abf 100644 (file)
@@ -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);
 
 
 
index 15a532fe34fc0663d6b4e4a41979e33348490441..884ba4a991934b54f75f9c53f48090e26a771d28 100644 (file)
@@ -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);
 
 
 
index 20edeb7b17c676cf5ef89a6d29fcb7cc7340f424..9bbcc54b416ce6067c8d4469e0781ac7c3148424 100644 (file)
@@ -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);
 
 }
 
index a51cceed79cfcddaaa4519fcacc29f41d6a9b18b..5b6906620ad7a4ade7c84320b6036ce7c7502ccc 100644 (file)
@@ -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);
 }
 
 
index a11e1cac411a3783399d013a0610d8cd1be26b77..50cb7258a7e75042d874ed6b77719c583e486087 100644 (file)
@@ -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);
 }
 
 
index 84e4a7d21c8b9bcba7cd35fa89d056aa167f8cda..62c4b68c2fa6343eaf4e4a0acf34d42c9966e4ae 100644 (file)
@@ -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);
 
 }
 
index d3258877fc7c2de9f00f53a252e358f965ccbc9c..246f385ed76556515b87f8c7289c87fc8b0dc141 100644 (file)
@@ -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);
 
 
 
index d3a776a5c29235b167e5a3e9d83d8a6bf4df4655..668e63dbbde2ce2d5f74975eccf01d13d12529aa 100644 (file)
@@ -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);
        }
 
 
index eec7883398c19bfaed1e09763dfd044d914032d9..e647c798166149983c5e41f01be7d27d68e63c7f 100644 (file)
@@ -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);
 
 }
 
index 92975ccfd2024aba55a5791d6c74316fc85b5096..5c976d9b06b882d4985b60e2ce9cd7937e9856f0 100644 (file)
@@ -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);
 }
 
 
index bd0b392d346443de6ecad59e9b619b0a330bd9f1..e7e16a9c0afdde58ced3fa5718b97c473f17678b 100644 (file)
@@ -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,
index adb61f5708ed2452b19345d1f055e58c6480f32d..ba5aa253841a00caef586900a825bb242cfc327b 100644 (file)
@@ -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);
 
 
 }
index 13dc5072eb285a302fd599845b92ae91fd1cc4ad..37b549c30a4f28c9555e6f15c933ce24cde79a7a 100644 (file)
@@ -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);
 
index f1dcaebe6e9406eaea1b106d5b059362380c010d..27b1134de2dad073ebc0a410fa8ffb2bfaed09c2 100644 (file)
@@ -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);
index 135d5877d16ef81367fb17617c1efccb2070bf87..dbb0466995a48c951f79aecdaea2a76f05c4a52a 100644 (file)
@@ -1474,7 +1474,6 @@ static void wimaxasncp_dissect_tlv_value(
         }
 
 
-        if (tree)
         {
             proto_tree *eap_tree;
             proto_item *item;