Text   |  XML   |  ReML   |   Visible Warnings:

Useless Assignment  at tap-iousers.c:202

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

iousers_tcpip_packet

(/home/sate/Testcases/c/cve/wireshark-1.2.0/tap-iousers.c)expand/collapse
Show more  
 193  iousers_tcpip_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vtcph)
 194  {
 195          io_users_t *iu=arg;
 196          const struct tcpheader *tcph=vtcph;
 197          char name1[256],name2[256];
 198          io_users_item_t *iui;
 199          int direction=0;
 200   
 201          if(tcph->th_sport>tcph->th_dport){
 202                  direction=0;
 203                  g_snprintf(name1,256,"%s:%s",address_to_str(&tcph->ip_src),get_tcp_port(tcph->th_sport));
 204                  g_snprintf(name2,256,"%s:%s",address_to_str(&tcph->ip_dst),get_tcp_port(tcph->th_dport));
 205          } else if(tcph->th_sport<tcph->th_dport){
 206                  direction=1;
 207                  g_snprintf(name2,256,"%s:%s",address_to_str(&tcph->ip_src),get_tcp_port(tcph->th_sport));
 208                  g_snprintf(name1,256,"%s:%s",address_to_str(&tcph->ip_dst),get_tcp_port(tcph->th_dport));
 209          } else if(CMP_ADDRESS(&tcph->ip_src, &tcph->ip_dst)>0){
 210                  direction=0;
 211                  g_snprintf(name1,256,"%s:%s",address_to_str(&tcph->ip_src),get_tcp_port(tcph->th_sport));
 212                  g_snprintf(name2,256,"%s:%s",address_to_str(&tcph->ip_dst),get_tcp_port(tcph->th_dport));
 213          } else {
 214                  direction=1;
 215                  g_snprintf(name2,256,"%s:%s",address_to_str(&tcph->ip_src),get_tcp_port(tcph->th_sport));
 216                  g_snprintf(name1,256,"%s:%s",address_to_str(&tcph->ip_dst),get_tcp_port(tcph->th_dport));
 217          }
 218   
 219          for(iui=iu->items;iui;iui=iui->next){
 220                  if((!strcmp(iui->name1, name1))
 221                  && (!strcmp(iui->name2, name2)) ){
 222                          break;
 223                  }
 224          }
 225   
 226          if(!iui){
 227                  iui=g_malloc(sizeof(io_users_item_t));
 228                  iui->next=iu->items;
 229                  iu->items=iui;
 230  /*              iui->addr1=NULL;*/
 231                  iui->name1=g_strdup(name1);
 232  /*              iui->addr2=NULL;*/
 233                  iui->name2=g_strdup(name2);
 234                  iui->frames1=0;
 235                  iui->frames2=0;
 236                  iui->bytes1=0;
 237                  iui->bytes2=0;
 238          }
 239   
 240          if(direction){
 241                  iui->frames1++;
 242                  iui->bytes1+=pinfo->fd->pkt_len;
 243          } else {
 244                  iui->frames2++;
 245                  iui->bytes2+=pinfo->fd->pkt_len;
 246          }
 247   
 248          return 1;
 249  }
Show more  




Change Warning 4866.30830 : Useless Assignment

Priority:
State:
Finding:
Owner:
Note: