Text   |  XML   |  ReML   |   Visible Warnings:

Redundant Condition  at flow_graph.c:343

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

flow_graph_tcp_add_to_graph

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/flow_graph.c)expand/collapse
Show more  
 310  static int flow_graph_tcp_add_to_graph(packet_info *pinfo, const struct tcpheader *tcph)
 311  {
 312    graph_analysis_item_t *gai;
 313    /* copied from packet-tcp */
 314    const gchar *fstr[] = {"FIN", "SYN", "RST", "PSH", "ACK", "URG", "ECN", "CWR" };
 315    guint i, bpos;
 316    gboolean flags_found = FALSE;
 317    gchar flags[64];
 318   
 319    gai = g_malloc(sizeof(graph_analysis_item_t));
 320    gai->frame_num = pinfo->fd->num;
 321    gai->time= nstime_to_sec(&pinfo->fd->rel_ts);
 322    if (node_addr_type == NET_SRCDST) {
 323      COPY_ADDRESS(&(gai->src_addr),&(pinfo->net_src));
 324      COPY_ADDRESS(&(gai->dst_addr),&(pinfo->net_dst));
 325    } else {
 326      COPY_ADDRESS(&(gai->src_addr),&(pinfo->src));
 327      COPY_ADDRESS(&(gai->dst_addr),&(pinfo->dst));
 328    }
 329    gai->port_src=pinfo->srcport;
 330    gai->port_dst=pinfo->destport;
 331   
 332    flags[0] = '\0';
 333    for (i = 0; i < 8; i++) {
 334      bpos = 1 << i;
 335      if (tcph->th_flags & bpos) {
 336        if (flags_found) {
 337          g_strlcat(flags, ", ", sizeof(flags));
 338        }
 339        g_strlcat(flags, fstr[i], sizeof(flags));
 340        flags_found = TRUE;
 341      }
 342    }
 343    if (flags[0] == '\0') {
 344      g_snprintf (flags, sizeof(flags), "<None>");
 345    }
 346   
 347    if ((tcph->th_have_seglen)&&(tcph->th_seglen!=0)){
 348      gai->frame_label = g_strdup_printf("%s - Len: %u",flags, tcph->th_seglen);
 349    }
 350    else{
 351      gai->frame_label = g_strdup(flags);
 352    }
 353   
 354    gai->comment = g_strdup_printf("Seq = %u Ack = %u",tcph->th_seq, tcph->th_ack);
 355   
 356    gai->line_style=1;
 357    gai->conv_num=0;
 358    gai->display=TRUE;
 359   
 360    graph_analysis->list = g_list_append(graph_analysis->list, gai);
 361   
 362    return 1;
 363   
 364  }
Show more  




Change Warning 4360.29699 : Redundant Condition

Priority:
State:
Finding:
Owner:
Note: