Text   |  XML   |  ReML   |   Visible Warnings:

Useless Assignment  at tap-iousers.c:83

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

iousers_udpip_packet

(/home/sate/Testcases/c/cve/wireshark-1.2.0/tap-iousers.c)expand/collapse
Show more  
 74  iousers_udpip_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vudph)
 75  {
 76          io_users_t *iu=arg;
 77          const e_udphdr *udph=vudph;
 78          char name1[256],name2[256];
 79          io_users_item_t *iui;
 80          int direction=0;
 81   
 82          if(udph->uh_sport>udph->uh_dport){
 83                  direction=0;
 84                  g_snprintf(name1,256,"%s:%s",address_to_str(&udph->ip_src),get_udp_port(udph->uh_sport));
 85                  g_snprintf(name2,256,"%s:%s",address_to_str(&udph->ip_dst),get_udp_port(udph->uh_dport));
 86          } else if(udph->uh_sport<udph->uh_dport){
 87                  direction=1;
 88                  g_snprintf(name2,256,"%s:%s",address_to_str(&udph->ip_src),get_udp_port(udph->uh_sport));
 89                  g_snprintf(name1,256,"%s:%s",address_to_str(&udph->ip_dst),get_udp_port(udph->uh_dport));
 90          } else if(CMP_ADDRESS(&udph->ip_src, &udph->ip_dst)>0){
 91                  direction=0;
 92                  g_snprintf(name1,256,"%s:%s",address_to_str(&udph->ip_src),get_udp_port(udph->uh_sport));
 93                  g_snprintf(name2,256,"%s:%s",address_to_str(&udph->ip_dst),get_udp_port(udph->uh_dport));
 94          } else {
 95                  direction=1;
 96                  g_snprintf(name2,256,"%s:%s",address_to_str(&udph->ip_src),get_udp_port(udph->uh_sport));
 97                  g_snprintf(name1,256,"%s:%s",address_to_str(&udph->ip_dst),get_udp_port(udph->uh_dport));
 98          }
 99   
 100          for(iui=iu->items;iui;iui=iui->next){
 101                  if((!strcmp(iui->name1, name1))
 102                  && (!strcmp(iui->name2, name2)) ){
 103                          break;
 104                  }
 105          }
 106   
 107          if(!iui){
 108                  iui=g_malloc(sizeof(io_users_item_t));
 109                  iui->next=iu->items;
 110                  iu->items=iui;
 111  /*              iui->addr1=NULL;*/
 112                  iui->name1=g_strdup(name1);
 113  /*              iui->addr2=NULL;*/
 114                  iui->name2=g_strdup(name2);
 115                  iui->frames1=0;
 116                  iui->frames2=0;
 117                  iui->bytes1=0;
 118                  iui->bytes2=0;
 119          }
 120   
 121          if(direction){
 122                  iui->frames1++;
 123                  iui->bytes1+=pinfo->fd->pkt_len;
 124          } else {
 125                  iui->frames2++;
 126                  iui->bytes2+=pinfo->fd->pkt_len;
 127          }
 128   
 129          return 1;
 130  }
Show more  




Change Warning 4864.30827 : Useless Assignment

Priority:
State:
Finding:
Owner:
Note: