summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorMichael Terry <mike@mterry.name>2017-08-12 20:16:21 -0400
committerOndrej Holy <oholy@redhat.com>2017-08-21 11:07:57 +0200
commit33f6ff08b5612f514ef3a6f11ddbf9b22bf0edc3 (patch)
treed85a90e10e3ab653d6e5d5d087f2e58a822b834a /client
parent0496270865f90e35b5d89f7fb3e7da2cc6aad942 (diff)
downloadgvfs-33f6ff08b5612f514ef3a6f11ddbf9b22bf0edc3.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
Diffstat (limited to 'client')
-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;