[nautilus/gnome-3-34] operations-ui-manager: Fix crash after a conflict dialog response



commit 52389750751e948621558f7d0c075ab406d01978
Author: Ondrej Holy <oholy redhat com>
Date:   Thu Jan 23 10:38:14 2020 +0000

    operations-ui-manager: Fix crash after a conflict dialog response
    
    After a conflict dialog response, Nautilus accesses an already released
    structure, which causes crashes for some people. Let's store pointer
    before releasing the structure in order to prevent the invalid reads.
    
    Fixes: https://gitlab.gnome.org/GNOME/nautilus/issues/1353
    
    
    (cherry picked from commit 7194ad7cb0257bfcdf7383e3bf42f34a218061a4)

 src/nautilus-operations-ui-manager.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-operations-ui-manager.c b/src/nautilus-operations-ui-manager.c
index fbaac05c9..43dbaf053 100644
--- a/src/nautilus-operations-ui-manager.c
+++ b/src/nautilus-operations-ui-manager.c
@@ -486,6 +486,7 @@ copy_move_conflict_ask_user_action (GtkWindow *parent_window,
                                     GFile     *destination_directory_name)
 {
     FileConflictDialogData *data;
+    FileConflictResponse *response;
 
     data = g_slice_new0 (FileConflictDialogData);
     data->parent = parent_window;
@@ -502,9 +503,10 @@ copy_move_conflict_ask_user_action (GtkWindow *parent_window,
                               run_file_conflict_dialog,
                               data);
 
+    response = g_steal_pointer (&data->response);
     g_slice_free (FileConflictDialogData, data);
 
-    return data->response;
+    return response;
 }
 
 typedef struct


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