summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Terry <mike@mterry.name>2017-08-12 20:16:21 -0400
committerOndrej Holy <oholy@redhat.com>2017-08-24 11:30:52 +0200
commita457579a8d1a857b531709a0446c5070e8dc2eae (patch)
tree3ad25e8e7a1cfc2bbea46751b7f67ee4a396755b
parenta33a843758300644a0c3c0cf517249252c73c41c (diff)
downloadgvfs-a457579a8d1a857b531709a0446c5070e8dc2eae.tar.gz
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
-rw-r--r--client/gdaemonfile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index ac24014c..2807c801 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;