Text   |  XML   |  ReML   |   Visible Warnings:

File System Race Condition  at file.c:3548

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

cf_save

(/home/sate/Testcases/c/cve/wireshark-1.2.0/file.c)expand/collapse
Show more  
 3516  cf_save(capture_file *cf, const char *fname, packet_range_t *range, guint save_format, gboolean compressed)
 3517  {
 3518    gchar        *from_filename;
 3519    int           err;
 3520    gboolean      do_copy;
 3521    wtap_dumper  *pdh;
 3522    save_callback_args_t callback_args;
 3523   
 3524    cf_callback_invoke(cf_cb_file_safe_started, (gpointer) fname);
 3525   
 3526    /* don't write over an existing file. */
 3527    /* this should've been already checked by our caller, just to be sure... */
 3528[+]   if (file_exists(fname)) {
 3529      simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
 3530        "%sCapture file: \"%s\" already exists!%s\n\n"
 3531        "Please choose a different filename.",
 3532        simple_dialog_primary_start(), fname, simple_dialog_primary_end());
 3533      goto fail;
 3534    }
 3535   
 3536    packet_range_process_init(range);
 3537   
 3538   
 3539[+]   if (packet_range_process_all(range) && save_format == cf->cd_t) {
 3540      /* We're not filtering packets, and we're saving it in the format 
 3541         it's already in, so we can just move or copy the raw data. */
 3542   
 3543      if (cf->is_tempfile) {
 3544        /* The file being saved is a temporary file from a live 
 3545           capture, so it doesn't need to stay around under that name;
 3546           first, try renaming the capture buffer file to the new name. */
 3547  #ifndef _WIN32 
 3548        if (ws_rename(cf->filename, fname) == 0) {
Show more  




Change Warning 3974.31770 : File System Race Condition

Priority:
State:
Finding:
Owner:
Note: