Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Control Flow  at packet-unistim.c:308

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

dissect_unistim

(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/unistim/packet-unistim.c)expand/collapse
Show more  
 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     /* heuristic*/
 227     switch(tvb_get_guint8(tvb,offset+4)) {/*rudp packet type 0,1,2 only */
 228        case 0x0:/*NAK*/
 229        case 0x1:/*ACK*/
 230           break;
 231        case 0x2:/*PAYLOAD*/
 232           switch(tvb_get_guint8(tvb,offset+5)){/*payload type 0,1,2,3,ff only */
 233              case 0x0:/*NULL*/
 234              case 0x1:/*UNISTIM*/
 235              case 0x2:/*UNISTIM WITH TERM ID*/
 236              case 0x3:/*UFTP*/
 237              case 0xff:/*UNKNOWN BUT VALID*/
 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        /* Clear out stuff in the info column */
 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      /* Allocate new mem for queueing */
 263      uinfo = se_alloc(sizeof(unistim_info_t));
 264   
 265      /* Clear tap struct */
 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);
 279      SET_ADDRESS(&uinfo->ni_ip, AT_NONE, 0, NULL);
 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                /*NAK*/
 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                /*ACK*/
 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;
 309      }
 310   
 311      /* Queue packet for tap */
 312      tap_queue_packet(unistim_tap, pinfo, uinfo);
 313      return size;
 314  }
Show more  




Change Warning 3892.34781 : Unreachable Control Flow

Priority:
State:
Finding:
Owner:
Note: