Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Control Flow  at packet-acse.c:1685

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

dissect_acse

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-acse.c)expand/collapse
Show more  
 1655  dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
 1656  {
 1657          int offset = 0;
 1658          proto_item    *item=NULL;
 1659          proto_tree    *tree=NULL;
 1660          char *oid;
 1661          asn1_ctx_t asn1_ctx;
 1662          asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
 1663   
 1664   
 1665          /* first, try to check length   */
 1666          /* do we have at least 2 bytes  */
 1667          if (!tvb_bytes_exist(tvb, 0, 2)){
 1668                  proto_tree_add_text(parent_tree, tvb, offset,
 1669                          tvb_reported_length_remaining(tvb,offset),
 1670                          "User data");
 1671                  return;  /* no, it isn't a ACSE PDU */
 1672          }
 1673          /* do we have spdu type from the session dissector?  */
 1674          if( !pinfo->private_data ){
 1675                  if(parent_tree){
 1676                          REPORT_DISSECTOR_BUG("Can't get SPDU type from session dissector.");
 1677                  }
 1678                  return  ;
 1679          } else {
 1680                  session  = ( (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data) );
 1681                  if(session->spdu_type == 0 ) {
 1682                          if(parent_tree){
 1683                                  REPORT_DISSECTOR_BUG(
 1684                                          ep_strdup_printf("Wrong spdu type %x from session dissector.",session->spdu_type));
 1685                                  return  ;
 1686                          }
 1687                  }
 1688          }
 1689          /* save parent_tree so subdissectors can create new top nodes */
 1690          top_tree=parent_tree;
 1691   
 1692          /*  ACSE has only AARQ,AARE,RLRQ,RLRE,ABRT type of pdu */
 1693          /*  reject everything else                              */
 1694          /*  data pdu is not ACSE pdu and has to go directly to app dissector */
 1695          switch(session->spdu_type){
 1696          case SES_CONNECTION_REQUEST:            /*   AARQ   */
 1697          case SES_CONNECTION_ACCEPT:             /*   AARE   */
 1698          case SES_REFUSE:                        /*   RLRE   */
 1699          case SES_DISCONNECT:                    /*   RLRQ   */
 1700          case SES_FINISH:                        /*   RLRE   */
 1701          case SES_ABORT:                         /*   ABRT   */
 1702                  break;
 1703          case SES_DATA_TRANSFER:
 1704                  oid=find_oid_by_pres_ctx_id(pinfo, indir_ref);
 1705                  if(oid){
 1706                          if(strcmp(oid, ACSE_APDU_OID) == 0){
 1707                                  proto_tree_add_text(parent_tree, tvb, offset, -1,
 1708                                      "Invalid OID: %s", ACSE_APDU_OID);
 1709                                  THROW(ReportedBoundsError);
 1710                          }
 1711                          call_ber_oid_callback(oid, tvb, offset, pinfo, parent_tree);
 1712                  } else {
 1713                          proto_item *ti = proto_tree_add_text(parent_tree, tvb, offset, -1, "dissector is not available");
 1714                          expert_add_info_format(pinfo, ti, PI_UNDECODED, PI_WARN, "Dissector is not available");
 1715                  }
 1716                  top_tree = NULL;
 1717                  return;
 1718          default:
 1719                  top_tree = NULL;
 1720                  return;
 1721          }
 1722   
 1723          /* create display subtree for the protocol */
 1724          if(parent_tree){
 1725                  item = proto_tree_add_item(parent_tree, proto_acse, tvb, 0, -1, FALSE);
 1726                  tree = proto_item_add_subtree(item, ett_acse);
 1727          }
 1728          if (check_col(pinfo->cinfo, COL_PROTOCOL))
 1729                  col_set_str(pinfo->cinfo, COL_PROTOCOL, "ACSE");
 1730          if (check_col(pinfo->cinfo, COL_INFO))
 1731                  col_clear(pinfo->cinfo, COL_INFO);
 1732   
 1733   
 1734          /*  we can't make any additional checking here   */
 1735          /*  postpone it before dissector will have more information */
 1736          while (tvb_reported_length_remaining(tvb, offset) > 0){
 1737                  int old_offset=offset;
 1738                  offset = dissect_acse_ACSE_apdu(FALSE, tvb, offset, &asn1_ctx, tree, -1);
 1739                  if(offset == old_offset ){
 1740                          proto_tree_add_text(tree, tvb, offset, -1,"Malformed packet");
 1741                          offset = tvb_length(tvb);
 1742                          break;
 1743                  }
 1744          }
 1745           
 1746  top_tree = NULL;
 1747  }
Show more  




Change Warning 3108.35033 : Unreachable Control Flow

Priority:
State:
Finding:
Owner:
Note: