[gvfs/gnome-3-24] client: Fix crash when calculating a relative path



commit a457579a8d1a857b531709a0446c5070e8dc2eae
Author: Michael Terry <mike mterry name>
Date:   Sat Aug 12 20:16:21 2017 -0400

    client: Fix crash when calculating a relative path
    
    Fix an if condition that resulted in trying to strdup(0x1).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786217

 client/gdaemonfile.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index ac24014..2807c80 100644
--- a/client/gdaemonfile.c
+++ b/client/gdaemonfile.c
@@ -389,7 +389,7 @@ g_daemon_file_get_relative_path (GFile *parent,
                                        parent_daemon->path, NULL);
 
       remainder = match_prefix (full_path_descendant, full_path_parent);
-      if (remainder == NULL || *remainder != '/')
+      if (remainder != NULL && *remainder == '/')
         ret = g_strdup (remainder + 1);
       else
         ret = NULL;


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