Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Control Flow  at packet-pn-mrp.c:353

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

dissect_PNMRP_PDU

(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/profinet/packet-pn-mrp.c)expand/collapse
Show more  
 314  dissect_PNMRP_PDU(tvbuff_t *tvb, int offset,  
 315          packet_info *pinfo, proto_tree *tree, proto_item *item)
 316  {
 317      guint16 version;
 318      guint8 type;
 319      guint8 length;
 320      gint i;
 321      tvbuff_t *tvb_new;
 322   
 323   
 324      /* MRP_Version */
 325      offset = dissect_pn_uint16(tvb, offset, pinfo, tree, hf_pn_mrp_version, &version);
 326   
 327      /* the rest of the packet has 4byte alignment regarding to the beginning of the next TLV block! */
 328      /* XXX - do we have to free this new tvb below? */
 329      tvb_new = tvb_new_subset(tvb, offset, -1, -1);
 330      offset = 0;
 331   
 332      for(i=0; tvb_length_remaining(tvb, offset) > 0; i++) {
 333          /* MRP_TLVHeader.Type */
 334          offset = dissect_pn_uint8(tvb_new, offset, pinfo, tree, hf_pn_mrp_type, &type);
 335   
 336          /* MRP_TLVHeader.Length */
 337          offset = dissect_pn_uint8(tvb_new, offset, pinfo, tree, hf_pn_mrp_length, &length);
 338   
 339          if(i != 0) {
 340              if (check_col(pinfo->cinfo, COL_INFO))
 341                col_append_fstr(pinfo->cinfo, COL_INFO, ", ");
 342   
 343              proto_item_append_text(item, ", ");
 344          }
 345   
 346          switch(type) {
 347          case(0x00):
 348              /* no content */
 349              if (check_col(pinfo->cinfo, COL_INFO))
 350                col_append_fstr(pinfo->cinfo, COL_INFO, "End");
 351              proto_item_append_text(item, "End");
 352              return offset;
 353              break;
 354          case(0x01):
 355              offset = dissect_PNMRP_Common(tvb_new, offset, pinfo, tree, item);
 356              break;
 357          case(0x02):
 358              offset = dissect_PNMRP_Test(tvb_new, offset, pinfo, tree, item);
 359              break;
 360          case(0x03):
 361              offset = dissect_PNMRP_TopologyChange(tvb_new, offset, pinfo, tree, item);
 362              break;
 363          case(0x04):
 364              offset = dissect_PNMRP_LinkDown(tvb_new, offset, pinfo, tree, item);
 365              break;
 366          case(0x05):
 367              offset = dissect_PNMRP_LinkUp(tvb_new, offset, pinfo, tree, item);
 368              break;
 369          case(0x7f):
 370              offset = dissect_PNMRP_Option(tvb_new, offset, pinfo, tree, item, length);
 371              break;
 372          default:
 373              offset = dissect_pn_undecoded(tvb, offset, pinfo, tree, length);
 374   
 375              if (check_col(pinfo->cinfo, COL_INFO))
 376                      col_append_fstr(pinfo->cinfo, COL_INFO, "Unknown TLVType 0x%x", type);
 377              proto_item_append_text(item, "Unknown TLVType 0x%x", type);
 378          }
 379      }
 380   
 381      return offset;
 382  }
Show more  




Change Warning 3879.31859 : Unreachable Control Flow

Priority:
State:
Finding:
Owner:
Note: