(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/profinet/packet-pn-mrrt.c) |
| |
| 115 | | | dissect_PNMRRT_PDU(tvbuff_t *tvb, int offset, |
| 116 | | | packet_info *pinfo, proto_tree *tree, proto_item *item) |
| 117 | | | { |
| 118 | | | guint16 version; |
| 119 | | | guint8 type; |
| 120 | | | guint8 length; |
| 121 | | | gint i =0; |
| 122 | | | |
| 123 | | | |
| 124 | | | |
| 125 | | | offset = dissect_pn_uint16(tvb, offset, pinfo, tree, hf_pn_mrrt_version, &version); |
| 126 | | | |
| 127 | | | while(tvb_length_remaining(tvb, offset) > 0) { |
| 128 | | | |
| 129 | | | offset = dissect_pn_uint8(tvb, offset, pinfo, tree, hf_pn_mrrt_type, &type); |
| 130 | | | |
| 131 | | | |
| 132 | | | offset = dissect_pn_uint8(tvb, offset, pinfo, tree, hf_pn_mrrt_length, &length); |
| 133 | | | |
| 134 | | | |
| 135 | | | if(i != 0) { |
| 136 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 137 | | | col_append_fstr(pinfo->cinfo, COL_INFO, ", "); |
| 138 | | | |
| 139 | | | proto_item_append_text(item, ", "); |
| 140 | | | } |
| 141 | | | |
| 142 | | | i++; |
| 143 | | | |
| 144 | | | switch(type) { |
| 145 | | | case(0x00): |
| 146 | | | |
| 147 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 148 | | | col_append_fstr(pinfo->cinfo, COL_INFO, "End"); |
| 149 | | | proto_item_append_text(item, "End"); |
| 150 | | | return offset; |
| 151 | | | break; |
Unreachable Control Flow
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 152 | | | case(0x01): |
| 153 | | | offset = dissect_PNMRRT_Common(tvb, offset, pinfo, tree, item, length); |
| 154 | | | break; |
| 155 | | | case(0x02): |
| 156 | | | offset = dissect_PNMRRT_Test(tvb, offset, pinfo, tree, item, length); |
| 157 | | | break; |
| 158 | | | default: |
| 159 | | | offset = dissect_pn_undecoded(tvb, offset, pinfo, tree, length); |
| 160 | | | |
| 161 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 162 | | | col_append_fstr(pinfo->cinfo, COL_INFO, "Unknown TLVType 0x%x", type); |
| 163 | | | proto_item_append_text(item, "Unknown TLVType 0x%x", type); |
| 164 | | | } |
| 165 | | | } |
| 166 | | | |
| 167 | | | return offset; |
| 168 | | | } |
| |