[nautilus/gnome-3-18] progress-info: check destination before referencing it



commit 3a391b2ab8fee42918726790f167ad558b34e183
Author: Razvan Chitu <razvan ch95 gmail com>
Date:   Wed Feb 24 15:20:49 2016 +0200

    progress-info: check destination before referencing it
    
    The progress info destination is obtainable through a getter function that
    returns a reference to it. This reference is created without checking if the
    destination is not null, which leads to critical warnings. In order to fix this,
    check the destination before creating the reference.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762609

 libnautilus-private/nautilus-progress-info.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/libnautilus-private/nautilus-progress-info.c b/libnautilus-private/nautilus-progress-info.c
index de913a3..95e7512 100644
--- a/libnautilus-private/nautilus-progress-info.c
+++ b/libnautilus-private/nautilus-progress-info.c
@@ -726,10 +726,12 @@ nautilus_progress_info_set_destination (NautilusProgressInfo *info,
 GFile *
 nautilus_progress_info_get_destination (NautilusProgressInfo *info)
 {
-        GFile *destination;
+        GFile *destination = NULL;
 
         G_LOCK (progress_info);
-        destination = g_object_ref (info->destination);
+        if (info->destination) {
+                destination = g_object_ref (info->destination);
+        }
         G_UNLOCK (progress_info);
 
         return destination;


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