[file-roller] Fix renaming files in a password-protected archive



commit e75ca5c43f7280fafe7c6a2c671bd950ff09eef3
Author: David King <dking redhat com>
Date:   Tue May 10 13:13:50 2016 +0100

    Fix renaming files in a password-protected archive
    
    When opening a password-protected archive, and renaming a file within,
    the password dialog takes user input, sets the password for the archive
    and then restarts the rename action. As part of doing so, it frees the
    existing action and replaces it with a duplicate. However, pointers to
    fields inside the original (now freed) action struct are used to
    provide the old and new filenames, among other arguments. This leads to
    the file being deleted (although accessing freed memory is undefined,
    so other outcomes are possible).
    
    Fix the rename operation by always using the fields from the new
    struct, which exists for the lifetime of the rename action.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1233853
    https://bugzilla.gnome.org/show_bug.cgi?id=766227

 src/fr-window.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/fr-window.c b/src/fr-window.c
index 4083a16..6a6bf07 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -8205,12 +8205,12 @@ rename_selection (FrWindow   *window,
        fr_window_clipboard_remove_file_list (window, file_list);
        fr_archive_rename (window->archive,
                           file_list,
-                          old_name,
-                          new_name,
-                          current_dir,
-                          is_dir,
-                          dir_in_archive,
-                          original_path,
+                          rdata->old_name,
+                          rdata->new_name,
+                          rdata->current_dir,
+                          rdata->is_dir,
+                          rdata->dir_in_archive,
+                          rdata->original_path,
                           window->priv->cancellable,
                           archive_rename_ready_cb,
                           window);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]