Text   |  XML   |  ReML   |   Visible Warnings:

Ignored Return Value  at packet-giop.c:5188

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

decode_ServiceContextList

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-giop.c)expand/collapse
Show more  
 5120  void decode_ServiceContextList(tvbuff_t *tvb, proto_tree *ptree, int *offset,
 5121                                 gboolean stream_is_be, guint32 boundary) {
 5122   
 5123    guint32 seqlen;               /* sequence length  */
 5124    guint32 context_data_len;             /* context data sequence length  */
 5125   
 5126    proto_tree *tree = NULL;      /* ServiceContext tree */
 5127    proto_tree *sub_tree1 = NULL;
 5128    proto_item *tf = NULL, *tf_st1;
 5129   
 5130    guint32 context_id;
 5131   
 5132    guint32 i;
 5133    guint32 vscid;                /* Vendor Service context id */
 5134    guint32 scid;
 5135    const gchar *service_context_name;
 5136    gboolean encapsulation_is_be;
 5137    guint32 encapsulation_boundary;
 5138    int temp_offset, temp_offset1;
 5139    int start_offset = *offset;
 5140   
 5141    /* create a subtree */
 5142   
 5143    if (ptree) {
 5144      /* set length to 0 now and correct with proto_item_set_len() later */
 5145      tf = proto_tree_add_text (ptree, tvb, *offset, 0, "ServiceContextList");
 5146   
 5147      tree = proto_item_add_subtree (tf, ett_giop_scl);
 5148    }
 5149   
 5150    /* Get sequence length (number of elements) */
 5151    seqlen = get_CDR_ulong(tvb,offset,stream_is_be,boundary);
 5152   
 5153    if (tree) {
 5154      proto_tree_add_uint(tree,hf_giop_sequence_length,tvb,
 5155                          *offset-sizeof(seqlen),4,seqlen);
 5156    }
 5157   
 5158    /* return if zero length sequence */
 5159   
 5160    if (seqlen == 0) {
 5161      if (tf) {
 5162        if (*offset - start_offset <= 0)
 5163          THROW(ReportedBoundsError);
 5164        proto_item_set_len(tf, *offset - start_offset);
 5165      }
 5166   
 5167      return;
 5168    }
 5169   
 5170    /* Loop for all ServiceContext's */
 5171   
 5172    for (i=0; i<seqlen; i++) {
 5173   
 5174      context_id = get_CDR_ulong(tvb,offset,stream_is_be,boundary);
 5175      vscid = (context_id & 0xffffff00) >> 8; /* vendor info, top 24 bits */
 5176      scid = context_id  & 0x000000ff; /* standard service info, lower 8 bits */
 5177   
 5178      if (tree) {
 5179          proto_tree_add_uint(tree,hf_giop_iop_vscid,tvb,
 5180            *offset-sizeof(guint32),4,vscid);
 5181   
 5182          proto_tree_add_uint(tree,hf_giop_iop_scid,tvb,
 5183            *offset-sizeof(guint32),4,scid);
 5184   
 5185       }
 5186   
 5187      if( vscid == 0) { /* OMG specified */
 5188         service_context_name = val_to_str(scid, service_context_ids, "(0x%x)");
 5189      } else { /* Proprietary vscid */
 5190         service_context_name = "Unknown";
 5191      }
 5192   
 5193      if(tree) {
 5194        proto_tree_add_text (tree, tvb, *offset -sizeof(context_id), 4,
 5195                             "Service Context ID: %s (%u)", service_context_name,
 5196                                             context_id);
 5197      }
 5198   
 5199      temp_offset1 = *offset;
 5200      /* The OMG has vscid of 0 reserved */
 5201      if( vscid != 0 || scid > max_service_context_id ) {
 5202          decode_UnknownServiceContext(tvb, tree, offset, stream_is_be, boundary);
 5203          continue;
 5204      }
 5205   
 5206      temp_offset = *offset;
 5207      /* get sequence length, new endianness and boundary for encapsulation */
 5208      context_data_len = get_CDR_encap_info(tvb, sub_tree1, offset,
 5209                                 stream_is_be, boundary,
 5210                                 &encapsulation_is_be , &encapsulation_boundary);
 5211   
 5212      if (tree) {
 5213        tf_st1 = proto_tree_add_text (tree, tvb, temp_offset, sizeof(context_data_len) + context_data_len , "%s", service_context_name);
 5214        sub_tree1 = proto_item_add_subtree (tf_st1, ett_giop_scl_st1);
 5215      }
 5216   
 5217      if (context_data_len == 0)
 5218          continue;
 5219   
 5220      /* See CORBA 3.0.2 standard, section Section 15.3.3 "Encapsulation",
 5221       * for how CDR types can be marshalled into a sequence<octet>.
 5222       * The first octet in the sequence determines endian order,
 5223       * 0 == big-endian, 1 == little-endian
 5224       */
 5225   
 5226      switch(scid)
 5227      {
 5228          case 0x01: /* Codesets */
 5229             decode_CodeSets(tvb, sub_tree1, offset,
 5230                                    encapsulation_is_be, encapsulation_boundary);
 5231             break;
 5232          case 0x0a: /* RTCorbaPriority */
 5233             decode_RTCorbaPriority(tvb, sub_tree1, offset,
 5234                                    encapsulation_is_be, encapsulation_boundary);
 5235             break;
 5236          default:
 5237   
 5238             /* Need to fill these in as we learn them */
 5239             *offset = temp_offset1;
 5240             decode_UnknownServiceContext(tvb, sub_tree1, offset, stream_is_be,
 5241                                          boundary);
 5242             break;
 5243      }
 5244      /* Set the offset to the end of the context_data sequence */
 5245      *offset = temp_offset1 + sizeof(context_data_len) + context_data_len;
 5246   
 5247    } /* for seqlen  */
 5248   
 5249    if (tf) {
 5250      if (*offset - start_offset <= 0)
 5251        THROW(ReportedBoundsError);
 5252      proto_item_set_len(tf, *offset - start_offset);
 5253    }
 5254   
 5255  }
Show more  




Change Warning 5490.35759 : Ignored Return Value

Priority:
State:
Finding:
Owner:
Note: