Text   |  XML   |  ReML   |   Visible Warnings:

Uninitialized Variable  at packet-per.c:1702

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

dissect_per_choice

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-per.c)expand/collapse
Show more  
 1617  dissect_per_choice(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, gint ett_index, const per_choice_t *choice, gint *value)
 1618  {
 1619          gboolean extension_present, extension_flag;
 1620          int extension_root_entries;
 1621          int extension_addition_entries;
 1622          guint32 choice_index;
 1623          int i, index, cidx;
 1624          guint32 ext_length;
 1625          guint32 old_offset = offset;
 1626          proto_item *choice_item = NULL;
 1627          proto_tree *choice_tree = NULL;
 1628   
 1629  DEBUG_ENTRY("dissect_per_choice");
 1630   
 1631          if (value) *value = -1;
 1632   
 1633          /* 22.5 */
 1634          if (choice[0].extension == ASN1_NO_EXTENSIONS){
 1635                  extension_present = FALSE;
 1636                  extension_flag = FALSE;
 1637          } else {
 1638                  extension_present = TRUE;
 1639[+]                 offset = dissect_per_boolean(tvb, offset, actx, tree, hf_per_extension_bit, &extension_flag);
 1640                  if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item);
 1641          }
 1642   
 1643          /* count the number of entries in the extension root and extension addition */
 1644          extension_root_entries = 0;
 1645          extension_addition_entries = 0;
 1646          for (i=0; choice[i].p_id; i++) {
 1647                  switch(choice[i].extension){
 1648                          case ASN1_NO_EXTENSIONS:
 1649                          case ASN1_EXTENSION_ROOT:
 1650                                  extension_root_entries++;
 1651                                  break;
 1652                          case ASN1_NOT_EXTENSION_ROOT:
 1653                                  extension_addition_entries++;
 1654                                  break;
 1655                  }
 1656          }
 1657   
 1658          if (!extension_flag) {  /* 22.6, 22.7 */
 1659                  if (extension_root_entries == 1) {  /* 22.5 */
 1660                          choice_index = 0;
 1661                  } else {
 1662                          offset = dissect_per_constrained_integer(tvb, offset, actx,
 1663                                  tree, hf_per_choice_index, 0, extension_root_entries - 1,
 1664                                  &choice_index, FALSE);
 1665                          if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item);
 1666                  }
 1667   
 1668                  index = -1; cidx = choice_index;
 1669                  for (i=0; choice[i].p_id; i++) {
 1670                          if(choice[i].extension != ASN1_NOT_EXTENSION_ROOT){
 1671                                  if (!cidx) { index = i; break; }
 1672                                  cidx--;
 1673                          }
 1674                  }
 1675          } else {  /* 22.8 */
 1676                  offset = dissect_per_normally_small_nonnegative_whole_number(tvb, offset, actx, tree, hf_per_choice_extension_index, &choice_index);
 1677[+]                 offset = dissect_per_length_determinant(tvb, offset, actx, tree, hf_per_open_type_length, &ext_length);
 1678   
 1679                  index = -1; cidx = choice_index;
 1680                  for (i=0; choice[i].p_id; i++) {
 1681                          if(choice[i].extension == ASN1_NOT_EXTENSION_ROOT){
 1682                                  if (!cidx) { index = i; break; }
 1683                                  cidx--;
 1684                          }
 1685                  }
 1686          }
 1687   
 1688          if (index != -1) {
 1689                  choice_item = proto_tree_add_uint(tree, hf_index, tvb, old_offset>>3, 0, choice[index].value);
 1690                  choice_tree = proto_item_add_subtree(choice_item, ett_index);
 1691                  if (!extension_flag) {
 1692                          offset = choice[index].func(tvb, offset, actx, choice_tree, *choice[index].p_id);
 1693                  } else {
 1694                          choice[index].func(tvb, offset, actx, choice_tree, *choice[index].p_id);
 1695                          offset += ext_length * 8;
 1696                  }
 1697                  proto_item_set_len(choice_item, BLEN(old_offset, offset));
 1698          } else {
 1699                  if (!extension_flag) {
 1700                          PER_NOT_DECODED_YET("unknown extension root index in choice");
 1701                  } else {
 1702                          offset += ext_length * 8;
Show more  




Change Warning 1312.31815 : Uninitialized Variable

Because they are very similar, this warning shares annotations with warning 1312.31816.

Priority:
State:
Finding:
Owner:
Note: