Text   |  XML   |  ReML   |   Visible Warnings:

Format String  at file.c:3378

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

cf_select_packet

(/home/sate/Testcases/c/cve/wireshark-1.2.0/file.c)expand/collapse
Show more  
 3329  cf_select_packet(capture_file *cf, int row)
 3330  {
 3331    frame_data *fdata;
 3332    int err;
 3333    gchar *err_info;
 3334   
 3335    /* Get the frame data struct pointer for this frame */
 3336    fdata = (frame_data *)packet_list_get_row_data(row);
 3337   
 3338    if (fdata == NULL) {
 3339      /* XXX - if a GtkCList's selection mode is GTK_SELECTION_BROWSE, when 
 3340         the first entry is added to it by "real_insert_row()", that row
 3341         is selected (see "real_insert_row()", in "gtk/gtkclist.c", in both
 3342         our version and the vanilla GTK+ version).
 3343   
 3344         This means that a "select-row" signal is emitted; this causes
 3345         "packet_list_select_cb()" to be called, which causes "cf_select_packet()"
 3346         to be called.
 3347   
 3348         "cf_select_packet()" fetches, above, the data associated with the 
 3349         row that was selected; however, as "gtk_clist_append()", which 
 3350         called "real_insert_row()", hasn't yet returned, we haven't yet 
 3351         associated any data with that row, so we get back a null pointer.
 3352   
 3353         We can't assume that there's only one frame in the frame list,
 3354         either, as we may be filtering the display.
 3355   
 3356         We therefore assume that, if "row" is 0, i.e. the first row 
 3357         is being selected, and "cf->first_displayed" equals 
 3358         "cf->last_displayed", i.e. there's only one frame being
 3359         displayed, that frame is the frame we want.
 3360   
 3361         This means we have to set "cf->first_displayed" and 
 3362         "cf->last_displayed" before adding the row to the
 3363         GtkCList; see the comment in "add_packet_to_packet_list()". */
 3364   
 3365         if (row == 0 && cf->first_displayed == cf->last_displayed)
 3366           fdata = cf->first_displayed;
 3367    }
 3368   
 3369    /* If fdata _still_ isn't set simply give up. */
 3370    if (fdata == NULL) {
 3371      return;
 3372    }
 3373   
 3374    /* Get the data in that frame. */
 3375    if (!wtap_seek_read (cf->wth, fdata->file_off, &cf->pseudo_header,
 3376                         cf->pd, fdata->cap_len, &err, &err_info)) {
 3377      simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
 3378                    cf_read_error_message(err, err_info), cf->filename);
 3379      return;
 3380    }
 3381   
 3382    /* Record that this frame is the current frame. */
 3383    cf->current_frame = fdata;
 3384    cf->current_row = row;
 3385   
 3386    /* Create the logical protocol tree. */
 3387    if (cf->edt != NULL) {
 3388      epan_dissect_free(cf->edt);
 3389      cf->edt = NULL;
 3390    }
 3391    /* We don't need the columns here. */
 3392    cf->edt = epan_dissect_new(TRUE, TRUE);
 3393   
 3394    epan_dissect_run(cf->edt, &cf->pseudo_header, cf->pd, cf->current_frame,
 3395            NULL);
 3396   
 3397    dfilter_macro_build_ftv_cache(cf->edt->tree);
 3398   
 3399    cf_callback_invoke(cf_cb_packet_selected, cf);
 3400  }
Show more  




Change Warning 5601.35912 : Format String

Priority:
State:
Finding:
Owner:
Note: