Text   |  XML   |  ReML   |   Visible Warnings:

Ignored Return Value  at packet-edonkey.c:3142

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

dissect_edonkey_udp

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-edonkey.c)expand/collapse
Show more  
 3114  static void dissect_edonkey_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 3115  {
 3116      proto_item *ti;
 3117      proto_tree *edonkey_tree = NULL, *edonkey_msg_tree = NULL;
 3118      int offset;
 3119      guint8 protocol, msg_type;
 3120      const gchar *protocol_name, *message_name;
 3121   
 3122      if (check_col(pinfo->cinfo, COL_PROTOCOL))
 3123          col_set_str(pinfo->cinfo, COL_PROTOCOL, "eDonkey");
 3124   
 3125      if (check_col(pinfo->cinfo, COL_INFO))
 3126          col_set_str(pinfo->cinfo, COL_INFO, "eDonkey UDP Message");
 3127   
 3128      if (tree) {
 3129          ti = proto_tree_add_item(tree, proto_edonkey, tvb, 0, -1, FALSE);
 3130          edonkey_tree = proto_item_add_subtree(ti, ett_edonkey);
 3131      }
 3132   
 3133      offset = 0;
 3134      /* eDonkey UDP message - Assume that there is one message per packet */
 3135      if (tvb_length_remaining(tvb, offset) >= EDONKEY_UDP_HEADER_LENGTH) {
 3136          protocol = tvb_get_guint8(tvb, offset);
 3137          msg_type = tvb_get_guint8(tvb, offset+1);
 3138          protocol_name = val_to_str(protocol, edonkey_protocols, "Unknown");
 3139   
 3140          if (protocol == EDONKEY_PROTO_KADEMLIA || protocol == EDONKEY_PROTO_KADEMLIA_COMP 
 3141              || protocol == EDONKEY_PROTO_ADU_KADEMLIA || protocol == EDONKEY_PROTO_ADU_KADEMLIA_COMP)
 3142              message_name = val_to_str( msg_type, kademlia_msgs, "Unknown");
 3143          else 
 3144              message_name = val_to_str(msg_type, edonkey_udp_msgs, "Unknown");
 3145   
 3146          if (check_col(pinfo->cinfo, COL_INFO)) {
 3147              col_add_fstr(pinfo->cinfo, COL_INFO, "%s UDP: %s", protocol_name, message_name);
 3148          }
 3149   
 3150          if (edonkey_tree) {
 3151              int remainingLength, extraBytes;
 3152   
 3153              ti = proto_tree_add_item(edonkey_tree, hf_edonkey_message, tvb, offset, -1, FALSE);
 3154              edonkey_msg_tree = proto_item_add_subtree(ti, ett_edonkey_message);
 3155   
 3156              proto_tree_add_uint_format(edonkey_msg_tree, hf_edonkey_protocol, tvb, offset, 1, protocol,
 3157                                         "Protocol: %s (0x%02x)", protocol_name, protocol);
 3158              proto_tree_add_uint_format(edonkey_msg_tree, hf_edonkey_message_type, tvb, offset+1, 1, msg_type,
 3159                                         "Message Type: %s (0x%02x)", message_name, msg_type);
 3160   
 3161              offset += EDONKEY_UDP_HEADER_LENGTH;
 3162              remainingLength = tvb_length_remaining( tvb, offset );
 3163   
 3164              switch (protocol) {
 3165                  case EDONKEY_PROTO_EDONKEY:
 3166                      offset = dissect_edonkey_udp_message(msg_type, tvb, pinfo, offset, remainingLength, edonkey_msg_tree);
 3167                      break;
 3168   
 3169                  case EDONKEY_PROTO_EMULE_EXT:
 3170                      offset = dissect_emule_udp_message(msg_type, tvb, pinfo, offset, remainingLength, edonkey_msg_tree);
 3171                      break;
 3172   
 3173                  case EDONKEY_PROTO_ADU_KADEMLIA:
 3174                  case EDONKEY_PROTO_KADEMLIA:
 3175                      offset = dissect_kademlia_udp_message(msg_type, tvb, pinfo, offset, remainingLength, edonkey_msg_tree);
 3176                      break;
 3177   
 3178                  case EDONKEY_PROTO_ADU_KADEMLIA_COMP:
 3179                  case EDONKEY_PROTO_KADEMLIA_COMP:
 3180                      offset = dissect_kademlia_udp_compressed_message(msg_type, tvb, pinfo, offset, remainingLength, edonkey_msg_tree);
 3181                      break;
 3182   
 3183                  default:
 3184                      break;
 3185              }
 3186   
 3187              extraBytes = tvb_length_remaining( tvb, offset );
 3188   
 3189              if ( extraBytes > 0 ) {
 3190                  /* trailing garbage or broken packet */
 3191                  proto_tree_add_uint_format(tree, hf_edonkey_unparsed_data_length, tvb, offset, extraBytes, extraBytes,
 3192                                             "Trailing/Undecoded data: %d bytes", extraBytes );
 3193              }
 3194          }
 3195      }
 3196  }
Show more  




Change Warning 5491.35702 : Ignored Return Value

Because they are very similar, this warning shares annotations with warnings 5491.35703 and 5491.35704.

Priority:
State:
Finding:
Owner:
Note: