Text   |  XML   |  ReML   |   Visible Warnings:

File System Race Condition  at filesystem.c:1579

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

file_save_as_ok_cb

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/capture_file_dlg.c)expand/collapse
Show more  
 1378  file_save_as_ok_cb(GtkWidget *w _U_, gpointer fs) {
 1379    gchar *cf_name;
 1380    gpointer  dialog;
 1381   
 1382    cf_name = g_strdup(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(fs)));
 1383   
 1384    /* Perhaps the user specified a directory instead of a file.
 1385       Check whether they did. */
 1386[+]   if (test_for_directory(cf_name) == EISDIR) {
 1387          /* It's a directory - set the file selection box to display that
 1388             directory, and leave the selection box displayed. */
 1389          set_last_open_dir(cf_name);
 1390          g_free(cf_name);
 1391          file_selection_set_current_folder(fs, get_last_open_dir());
 1392          return;
 1393    }
 1394   
 1395    /* Check whether the range is valid. */
 1396[+]   if (!range_check_validity(&range)) {
 1397      /* The range isn't valid; don't dismiss the open dialog box,
 1398         just leave it around so that the user can, after they
 1399         dismiss the alert box popped up for the error, try again. */
 1400      g_free(cf_name);
 1401      /* XXX - as we cannot start a new event loop (using gtk_dialog_run()),
 1402       * as this will prevent the user from closing the now existing error
 1403       * message, simply close the dialog (this is the best we can do here). */
 1404      if (file_save_as_w)
 1405        window_destroy(GTK_WIDGET (fs));
 1406   
 1407      return;
 1408    }
 1409   
 1410    /*
 1411     * Check that the from file is not the same as to file
 1412     * We do it here so we catch all cases ...
 1413     * Unfortunately, the file requester gives us an absolute file
 1414     * name and the read file name may be relative (if supplied on
 1415     * the command line). From Joerg Mayer.
 1416     */
 1417[+]   if (files_identical(cfile.filename, cf_name)) {
expand/collapse

files_identical

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/filesystem.c)expand/collapse
Show more  
 1538  files_identical(const char *fname1, const char *fname2)
 1539  {
 1540          /* Two different implementations, because:
 1541           *
 1542           * - _fullpath is not available on UN*X, so we can't get full
 1543           *   paths and compare them (which wouldn't work with hard links
 1544           *   in any case);
 1545           *
 1546           * - st_ino isn't filled in with a meaningful value on Windows.
 1547           */
 1548  #ifdef _WIN32 
 1549
1566
Show [ Lines 1549 to 1566 omitted. ]
 1567                  return TRUE;
 1568          } else {
 1569                  return FALSE;
 1570          }
 1571  #else
 1572          struct stat   filestat1, filestat2;
 1573   
 1574          /*
 1575           * Compare st_dev and st_ino.
 1576           */
 1577          if (ws_stat(fname1, &filestat1) == -1)
 1578                  return FALSE;   /* can't get info about the first file */
 1579          if (ws_stat(fname2, &filestat2) == -1)
Show more  
Show more  




Change Warning 3981.32770 : File System Race Condition

Priority:
State:
Finding:
Owner:
Note: