Text   |  XML   |  ReML   |   Visible Warnings:

Ignored Return Value  at packet-lldp.c:2255

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

dissect_organizational_specific_tlv

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-lldp.c)expand/collapse
Show more  
 2233  dissect_organizational_specific_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset)
 2234  {
 2235          guint16 tempLen;
 2236          guint16 tempShort;
 2237          guint32 oui;
 2238          guint8 subType;
 2239          const char *ouiStr;
 2240          const char *subTypeStr;
 2241   
 2242          proto_tree      *org_tlv_tree = NULL;
 2243          proto_item      *tf = NULL;
 2244   
 2245          /* Get tlv type and length */
 2246          tempShort = tvb_get_ntohs(tvb, offset);
 2247   
 2248          /* Get tlv length */
 2249          tempLen = TLV_INFO_LEN(tempShort);
 2250   
 2251          /* Get OUI value */
 2252          oui = tvb_get_ntoh24(tvb, (offset+2));
 2253          subType = tvb_get_guint8(tvb, (offset+5));
 2254   
 2255          ouiStr = val_to_str(oui, tlv_oui_subtype_vals, "Unknown");
 2256          switch(oui)
 2257          {
 2258          case OUI_IEEE_802_1:
 2259                  subTypeStr = val_to_str(subType, ieee_802_1_subtypes, "Unknown subtype 0x%x");
 2260                  break;
 2261          case OUI_IEEE_802_3:
 2262                  subTypeStr = val_to_str(subType, ieee_802_3_subtypes, "Unknown subtype 0x%x");
 2263                  break;
 2264          case OUI_MEDIA_ENDPOINT:
 2265                  subTypeStr = val_to_str(subType, media_subtypes, "Unknown subtype 0x%x");
 2266                  break;
 2267          case OUI_PROFINET:
 2268                  subTypeStr = val_to_str(subType, profinet_subtypes, "Reserved (0x%x)");
 2269                  break;
 2270          default:
 2271                  subTypeStr = "Unknown";
 2272                  break;
 2273          }
 2274   
 2275          if (tree)
 2276          {
 2277                  tf = proto_tree_add_text(tree, tvb, offset, (tempLen + 2), "%s - %s",
 2278                      ouiStr, subTypeStr);
 2279                  org_tlv_tree = proto_item_add_subtree(tf, ett_org_spc_tlv);
 2280   
 2281                  proto_tree_add_item(org_tlv_tree, hf_lldp_tlv_type, tvb, offset, 2, FALSE);
 2282          }
 2283          if (tempLen < 4)
 2284          {
 2285                  if (tree)
 2286                          proto_tree_add_uint_format(org_tlv_tree, hf_lldp_tlv_len, tvb, offset, 2,
 2287                              tempShort, "TLV Length: %u (too short, must be >= 4)", tempLen);
 2288   
 2289                  return (tempLen + 2);
 2290          }
 2291          if (tree)
 2292          {
 2293                  proto_tree_add_item(org_tlv_tree, hf_lldp_tlv_len, tvb, offset, 2, FALSE);
 2294   
 2295                  /* Display organizational unique id */
 2296                  proto_tree_add_uint(org_tlv_tree, hf_org_spc_oui, tvb, (offset+2), 3, oui);
 2297          }
 2298   
 2299          switch (oui)
 2300          {
 2301          case OUI_IEEE_802_1:
 2302                  dissect_ieee_802_1_tlv(tvb, pinfo, org_tlv_tree, (offset+5));
 2303                  break;
 2304          case OUI_IEEE_802_3:
 2305                  dissect_ieee_802_3_tlv(tvb, pinfo, org_tlv_tree, (offset+5));
 2306                  break;
 2307          case OUI_MEDIA_ENDPOINT:
 2308                  dissect_media_tlv(tvb, pinfo, org_tlv_tree, (offset+5), (guint16) (tempLen-3));
 2309                  break;
 2310          case OUI_PROFINET:
 2311                  dissect_profinet_tlv(tvb, pinfo, org_tlv_tree, (offset+5), (guint16) (tempLen-3));
 2312                  break;
 2313          default:
 2314                  proto_tree_add_item(org_tlv_tree, hf_unknown_subtype, tvb, (offset+5), (guint16) (tempLen-3), FALSE);
 2315          }
 2316   
 2317          return (tempLen + 2);
 2318  }
Show more  




Change Warning 5483.35741 : Ignored Return Value

Because they are very similar, this warning shares annotations with warnings 5483.35742, 5483.35743, 5483.35744, and 5483.35745.

Priority:
State:
Finding:
Owner:
Note: