(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/unistim/packet-unistim.c) |
| |
| 218 | | | dissect_unistim(tvbuff_t *tvb,packet_info *pinfo,proto_tree *tree){ |
| 219 | | | gint offset=0; |
| 220 | | | proto_item *ti= NULL; |
| 221 | | | proto_item *ti1= NULL; |
| 222 | | | proto_tree *overall_unistim_tree = NULL; |
| 223 | | | proto_tree *rudpm_tree=NULL; |
| 224 | | | gint size; |
| 225 | | | |
| 226 | | | |
| 227 | | | switch(tvb_get_guint8(tvb,offset+4)) { |
| 228 | | | case 0x0: |
| 229 | | | case 0x1: |
| 230 | | | break; |
| 231 | | | case 0x2: |
| 232 | | | switch(tvb_get_guint8(tvb,offset+5)){ |
| 233 | | | case 0x0: |
| 234 | | | case 0x1: |
| 235 | | | case 0x2: |
| 236 | | | case 0x3: |
| 237 | | | case 0xff: |
| 238 | | | break; |
| 239 | | | default: |
| 240 | | | return 0; |
| 241 | | | } |
| 242 | | | break; |
| 243 | | | default: |
| 244 | | | return 0; |
| 245 | | | } |
| 246 | | | |
| 247 | | | |
| 248 | | | size=tvb_length_remaining(tvb, offset); |
| 249 | | | if(check_col(pinfo->cinfo,COL_PROTOCOL)) |
| 250 | | | col_set_str(pinfo->cinfo,COL_PROTOCOL,"UNISTIM"); |
| 251 | | | |
| 252 | | | if (check_col(pinfo->cinfo,COL_INFO)) { |
| 253 | | | col_clear(pinfo->cinfo,COL_INFO); |
| 254 | | | } |
| 255 | | | ti = proto_tree_add_item(tree,proto_unistim,tvb,offset,-1,FALSE); |
| 256 | | | overall_unistim_tree = proto_item_add_subtree(ti,ett_unistim); |
| 257 | | | ti1=proto_tree_add_text(overall_unistim_tree,tvb,offset,5,"Reliable UDP"); |
| 258 | | | rudpm_tree=proto_item_add_subtree(ti1,ett_unistim); |
| 259 | | | |
| 260 | | | proto_tree_add_item(rudpm_tree,hf_unistim_seq_nu,tvb,offset,4,FALSE); |
| 261 | | | |
| 262 | | | |
| 263 | | | uinfo = se_alloc(sizeof(unistim_info_t)); |
| 264 | | | |
| 265 | | | |
| 266 | | | uinfo->rudp_type = 0; |
| 267 | | | uinfo->payload_type = 0; |
| 268 | | | uinfo->sequence = tvb_get_ntohl(tvb,offset); |
| 269 | | | uinfo->termid = 0; |
| 270 | | | uinfo->key_val = -1; |
| 271 | | | uinfo->key_state = -1; |
| 272 | | | uinfo->hook_state = -1; |
| 273 | | | uinfo->stream_connect = -1; |
| 274 | | | uinfo->trans_connect = -1; |
| 275 | | | uinfo->set_termid = -1; |
| 276 | | | uinfo->string_data = NULL; |
| 277 | | | uinfo->key_buffer = NULL; |
| 278 | | | SET_ADDRESS(&uinfo->it_ip, AT_NONE, 0, NULL);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/address.h |
| |
66 | #define SET_ADDRESS(addr, addr_type, addr_len, addr_data) { \ |
67 | (addr)->type = (addr_type); \ |
68 | (addr)->len = (addr_len); \ |
69 | (addr)->data = (addr_data); \ |
70 | } |
| |
|
| 279 | | | SET_ADDRESS(&uinfo->ni_ip, AT_NONE, 0, NULL);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/address.h |
| |
66 | #define SET_ADDRESS(addr, addr_type, addr_len, addr_data) { \ |
67 | (addr)->type = (addr_type); \ |
68 | (addr)->len = (addr_len); \ |
69 | (addr)->data = (addr_data); \ |
70 | } |
| |
|
| 280 | | | uinfo->it_port = 0; |
| 281 | | | |
| 282 | | | offset+=4; |
| 283 | | | proto_tree_add_item(rudpm_tree,hf_unistim_packet_type,tvb,offset,1,FALSE); |
| 284 | | | uinfo->rudp_type = tvb_get_guint8(tvb,offset); |
| 285 | | | |
| 286 | | | switch(tvb_get_guint8(tvb,offset)) { |
| 287 | | | case 0x00: |
| 288 | | | |
| 289 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 290 | | | col_add_fstr(pinfo->cinfo, COL_INFO, "NAK for seq - 0x%X", |
| 291 | | | tvb_get_ntohl(tvb, offset-4)); |
| 292 | | | break; |
| 293 | | | case 0x01: |
| 294 | | | |
| 295 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 296 | | | col_add_fstr(pinfo->cinfo, COL_INFO, "ACK for seq - 0x%X", |
| 297 | | | tvb_get_ntohl(tvb, offset-4)); |
| 298 | | | break; |
| 299 | | | case 0x02: |
| 300 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 301 | | | col_add_fstr(pinfo->cinfo, COL_INFO, "Payload seq - 0x%X", |
| 302 | | | tvb_get_ntohl(tvb, offset-4)); |
| 303 | | | offset+=1; |
| 304 | | | dissect_payload(overall_unistim_tree,tvb,offset,pinfo); |
| 305 | | | break; |
| 306 | | | default: |
| 307 | | | return 0; |
| 308 | | | break; |
Unreachable Control Flow
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 309 | | | } |
| 310 | | | |
| 311 | | | |
| 312 | | | tap_queue_packet(unistim_tap, pinfo, uinfo); |
| 313 | | | return size; |
| 314 | | | } |
| |