[gvfs] client: Always set path[12]_out in create_proxy_for_file2
- From: Ross Lagerwall <rossl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] client: Always set path[12]_out in create_proxy_for_file2
- Date: Wed, 20 May 2015 06:46:10 +0000 (UTC)
commit 7056e01cceea3e6a8970c1fc4637ad959e7cd3de
Author: Ross Lagerwall <rosslagerwall gmail com>
Date: Sat May 16 08:13:23 2015 +0100
client: Always set path[12]_out in create_proxy_for_file2
d59e6873086f ("Fix 'path[12]_out' leak in file_transfer()") assumed that
path[12]_out were always set by create_proxy_for_file2 but this is not
always the case. Fix it so that create_proxy_for_file2 always sets
path[12]_out.
To reproduce the bug:
$ gvfs-copy --progress smb://host/unmounted/a smb://host/unmounted/b
Segmentation fault (core dumped)
https://bugzilla.gnome.org/show_bug.cgi?id=749462
client/gdaemonfile.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index db36913..b744d53 100644
--- a/client/gdaemonfile.c
+++ b/client/gdaemonfile.c
@@ -435,6 +435,11 @@ create_proxy_for_file2 (GFile *file1,
GMountInfo *mount_info1, *mount_info2;
GDBusConnection *connection;
+ if (path1_out)
+ *path1_out = NULL;
+ if (path2_out)
+ *path2_out = NULL;
+
proxy = NULL;
mount_info2 = NULL;
@@ -487,13 +492,8 @@ create_proxy_for_file2 (GFile *file1,
*mount_info2_out = g_mount_info_ref (mount_info2);
if (path1_out)
*path1_out = g_strdup (g_mount_info_resolve_path (mount_info1, daemon_file1->path));
- if (path2_out)
- {
- if (mount_info2)
- *path2_out = g_strdup (g_mount_info_resolve_path (mount_info2, daemon_file2->path));
- else
- *path2_out = NULL;
- }
+ if (path2_out && mount_info2)
+ *path2_out = g_strdup (g_mount_info_resolve_path (mount_info2, daemon_file2->path));
if (connection_out)
*connection_out = connection;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]