Text   |  XML   |  ReML   |   Visible Warnings:

Uninitialized Variable  at packet-infiniband.c:1529

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

dissect_general_info

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-infiniband.c)expand/collapse
Show more  
 2937  static void dissect_general_info(tvbuff_t *tvb, gint offset, packet_info *pinfo)
 2938  {
 2939      guint8 lnh_val = 0;             /* The Link Next Header Value.  Tells us which headers are coming */
 2940      gboolean bthFollows = 0;        /* Tracks if we are parsing a BTH.  This is a significant decision point */
 2941      guint8 virtualLane = 0;         /* The Virtual Lane of the current Packet */
 2942      guint8 opCode = 0;              /* OpCode from BTH header. */
 2943      gint32 nextHeaderSequence = -1; /* defined by this dissector. #define which indicates the upcoming header sequence from OpCode */
 2944      guint8 nxtHdr = 0;              /* that must be available for that header. */
 2945      struct e_in6_addr SRCgid;       /* Struct to display ipv6 Address */
 2946      struct e_in6_addr DSTgid;       /* Struct to display ipv6 Address */
 2947      guint8 management_class = 0;
 2948      MAD_Data MadData;
 2949   
 2950   
 2951      virtualLane =  tvb_get_guint8(tvb, offset);
 2952      virtualLane = virtualLane & 0xF0;
 2953      offset+=1;
 2954   
 2955      /* Save Link Next Header... This tells us what the next header is. */
 2956      lnh_val =  tvb_get_guint8(tvb, offset);
 2957      lnh_val = lnh_val & 0x03;
 2958      offset+=1;
 2959   
 2960      /* Set destination in packet view. */
 2961[+]     if (check_col(pinfo->cinfo, COL_DEF_DST))
 2962      {
 2963          col_add_fstr(pinfo->cinfo, COL_DEF_DST, "DLID: %s", tvb_bytes_to_str(tvb, offset, 2));
 2964      }
 2965      offset+=4;
 2966   
 2967      /* Set Source in packet view. */
 2968[+]     if (check_col(pinfo->cinfo, COL_DEF_SRC))
 2969      {
 2970          col_add_fstr(pinfo->cinfo, COL_DEF_SRC, "SLID: %s", tvb_bytes_to_str(tvb, offset, 2));
 2971      }
 2972      offset+=2;
 2973   
 2974      switch(lnh_val)
 2975      {
 2976          case IBA_GLOBAL:
 2977              offset +=6;
 2978              nxtHdr = tvb_get_guint8(tvb, offset);
 2979              offset += 2;
 2980   
 2981              tvb_get_ipv6(tvb, offset, &SRCgid);
 2982              if (check_col(pinfo->cinfo, COL_DEF_SRC))
 2983              {
 2984                  col_add_fstr(pinfo->cinfo, COL_DEF_SRC, "SGID: %s", ip6_to_str(&SRCgid));
 2985              }
 2986              offset += 16;
 2987   
 2988              tvb_get_ipv6(tvb, offset, &DSTgid);
 2989              if (check_col(pinfo->cinfo, COL_DEF_DST))
 2990              {
 2991                  col_add_fstr(pinfo->cinfo, COL_DEF_DST, "DGID: %s", ip6_to_str(&DSTgid));
 2992              }
 2993              offset += 16;
 2994   
 2995              if(nxtHdr != 0x1B)
 2996              {
 2997                  /* Some kind of packet being transported globally with IBA, but locally it is not IBA - no BTH following. */
 2998                  break;
 2999              }
 3000              /* else 
 3001               * {
 3002               *      Fall through switch and start parsing Local Headers and BTH 
 3003               * }
 3004               */
 3005          case IBA_LOCAL:
 3006              bthFollows = TRUE;
 3007   
 3008              /* Get the OpCode - this tells us what headers are following */
 3009
3019
Show [ Lines 3009 to 3019 omitted. ]
 3020                  col_set_str(pinfo->cinfo, COL_DEF_DST, "IPv6 over IB Packet");
 3021                  col_set_fence(pinfo->cinfo, COL_DEF_DST);
 3022              }
 3023              break;
 3024          case RAW:
 3025              break;
 3026          default:
 3027              break;
 3028      }
 3029   
 3030      if(bthFollows)
 3031      {
 3032          /* Find our next header sequence based on the Opcode 
 3033           * Since we're not doing dissection here, we just need the proper offsets to get our labels in packet view */
 3034   
 3035          nextHeaderSequence = find_next_header_sequence((guint32) opCode);
 3036          switch(nextHeaderSequence)
 3037          {
 3038              case RDETH_DETH_PAYLD:
 3039                  offset += 4; /* RDETH */
 3040                  offset += 8; /* DETH */
 3041
3115
Show [ Lines 3041 to 3115 omitted. ]
 3116                  offset += 4; /* IETH */
 3117                  break;
 3118              case DETH_IMMDT_PAYLD:
 3119                  offset += 8; /* DETH */
 3120                  offset += 4; /* IMMDT */
 3121                  break;
 3122              default:
 3123                  break;
 3124          }
 3125      }
 3126      if(virtualLane == 0xF0)
 3127      {
 3128[+]         management_class =  tvb_get_guint8(tvb, offset + 1);
 3129          if(((management_class >= (guint8)VENDOR_1_START) && (management_class <= (guint8)VENDOR_1_END))
 3130          || ((management_class >= (guint8)VENDOR_2_START) && (management_class <= (guint8)VENDOR_2_END)))
 3131          {
 3132              return;
 3133          }
 3134          else if((management_class >= (guint8)APPLICATION_START) && (management_class <= (guint8)APPLICATION_END))
 3135          {
 3136              return;
 3137          }
 3138          else if(((management_class == (guint8)0x00) || (management_class == (guint8)0x02))
 3139              || ((management_class >= (guint8)0x50) && (management_class <= (guint8)0x80))
 3140              || ((management_class >= (guint8)0x82)))
 3141          {
 3142              return;
 3143          }
 3144          else /* we have a normal management_class */
 3145          {
 3146[+]             parse_MAD_Common(NULL, tvb, &offset, &MadData);
 3147[+]             label_SUBM_Method(NULL, &MadData, pinfo);
 3148[+]             label_SUBM_Attribute(NULL, &MadData, pinfo);
expand/collapse

label_SUBM_Attribute

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-infiniband.c)expand/collapse
Show more  
 1527  static void label_SUBM_Attribute(proto_item *SubMItem, MAD_Data *MadHeader, packet_info *pinfo)
 1528  {
 1529      const char *label = val_to_str(MadHeader->attributeID, SUBM_Attributes, "(Unknown SubManagement Attribute!)");
Show more  
Show more  




Change Warning 2675.32899 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: