Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at summary_dlg.c:194

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

summary_open_cb

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/summary_dlg.c)expand/collapse
Show more  
 104  summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
 105  {
 106    summary_tally summary;
 107    GtkWidget     *sum_open_w,
 108                  *main_vb, *bbox, *close_bt, *help_bt;
 109    GtkWidget     *table;
 110    GtkWidget     *list;
 111    static const char *titles[] = { "Traffic", "Captured", "Displayed", "Marked" };
 112   
 113    gchar         string_buff[SUM_STR_MAX];
 114    gchar         string_buff2[SUM_STR_MAX];
 115    gchar         string_buff3[SUM_STR_MAX];
 116   
 117    double        seconds;
 118    double        disp_seconds;
 119    double        marked_seconds;
 120    guint         offset;
 121    guint         snip;
 122    guint         row;
 123    gchar        *str_dup;
 124    gchar        *str_work;
 125   
 126    time_t        ti_time;
 127    struct tm    *ti_tm;
 128    unsigned int  elapsed_time;
 129   
 130    /* initial computations */
 131    summary_fill_in(&cfile, &summary);
 132  #ifdef HAVE_LIBPCAP 
 133    summary_fill_in_capture(&global_capture_opts, &summary);
 134  #endif
 135    seconds = summary.stop_time - summary.start_time;
 136    disp_seconds = summary.filtered_stop - summary.filtered_start;
 137    marked_seconds = summary.marked_stop - summary.marked_start;
 138   
 139    sum_open_w = window_new(GTK_WINDOW_TOPLEVEL, "Wireshark: Summary");
 140   
 141    /* Container for each row of widgets */
 142    main_vb = gtk_vbox_new(FALSE, 12);
 143    gtk_container_set_border_width(GTK_CONTAINER(main_vb), 12);
 144    gtk_container_add(GTK_CONTAINER(sum_open_w), main_vb);
 145   
 146    /* table */
 147    table = gtk_table_new(1, 2, FALSE);
 148    gtk_table_set_col_spacings(GTK_TABLE(table), 6);
 149    gtk_table_set_row_spacings(GTK_TABLE(table), 3);
 150    gtk_container_add(GTK_CONTAINER(main_vb), table);
 151    row = 0;
 152   
 153   
 154    /* File */
 155    add_string_to_table(table, &row, "File", "");
 156   
 157    /* filename */
 158    g_snprintf(string_buff, SUM_STR_MAX, "%s", summary.filename);
 159    add_string_to_table(table, &row, "Name:", string_buff);
 160   
 161    /* length */
 162    g_snprintf(string_buff, SUM_STR_MAX, "%" G_GINT64_MODIFIER "d bytes", summary.file_length);
 163    add_string_to_table(table, &row, "Length:", string_buff);
 164   
 165    /* format */
 166    g_snprintf(string_buff, SUM_STR_MAX, "%s", wtap_file_type_string(summary.file_type));
 167    add_string_to_table(table, &row, "Format:", string_buff);
 168   
 169    /* encapsulation */
 170    g_snprintf(string_buff, SUM_STR_MAX, "%s", wtap_encap_string(summary.encap_type));
 171    add_string_to_table(table, &row, "Encapsulation:", string_buff);
 172   
 173    if (summary.has_snap) {
 174      /* snapshot length */
 175      g_snprintf(string_buff, SUM_STR_MAX, "%u bytes", summary.snap);
 176      add_string_to_table(table, &row, "Packet size limit:", string_buff);
 177    }
 178   
 179   
 180    /* Time */
 181    add_string_to_table(table, &row, "", "");
 182    add_string_to_table(table, &row, "Time", "");
 183   
 184    /* start time */
 185    ti_time = (time_t)summary.start_time;
 186    ti_tm = localtime(&ti_time);
 187    g_snprintf(string_buff, SUM_STR_MAX,
 188               "%04d-%02d-%02d %02d:%02d:%02d",
 189               ti_tm->tm_year + 1900,
 190               ti_tm->tm_mon + 1,
 191               ti_tm->tm_mday,
 192               ti_tm->tm_hour,
 193               ti_tm->tm_min,
 194               ti_tm->tm_sec);
Show more  




Change Warning 4283.30580 : Null Pointer Dereference

Because they are very similar, this warning shares annotations with warning 4283.30581.

Priority:
State:
Finding:
Owner:
Note: