summaryrefslogtreecommitdiff
path: root/client/gdaemonfile.c
diff options
context:
space:
mode:
authorRoss Lagerwall <rosslagerwall@gmail.com>2013-10-28 11:59:30 +0200
committerRoss Lagerwall <rosslagerwall@gmail.com>2013-10-31 14:41:20 +0200
commita9c38f1b15e56f2d08d5ffccd0483aee68095c00 (patch)
tree7b44dbbc8136c572eb23c906d7dc784ce993c4a0 /client/gdaemonfile.c
parentde923addad07af49a810ad375e124dcb6379da5b (diff)
downloadgvfs-a9c38f1b15e56f2d08d5ffccd0483aee68095c00.tar.gz
Don't crash if mount_operation is given as NULL
Check for NULL before using the mount_operation given to any of GDaemonFile's methods to prevent a crash due to refing NULL. https://bugzilla.gnome.org/show_bug.cgi?id=710995
Diffstat (limited to 'client/gdaemonfile.c')
-rw-r--r--client/gdaemonfile.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index 48c7c82d..58c9cf96 100644
--- a/client/gdaemonfile.c
+++ b/client/gdaemonfile.c
@@ -1482,7 +1482,8 @@ g_daemon_file_mount_mountable (GFile *file,
data = g_new0 (AsyncMountOp, 1);
data->flags = flags;
- data->mount_operation = g_object_ref (mount_operation);
+ if (mount_operation)
+ data->mount_operation = g_object_ref (mount_operation);
if (cancellable)
data->cancellable = g_object_ref (cancellable);
@@ -1573,7 +1574,8 @@ g_daemon_file_start_mountable (GFile *file,
data = g_new0 (AsyncMountOp, 1);
data->flags = flags;
- data->mount_operation = g_object_ref (mount_operation);
+ if (mount_operation)
+ data->mount_operation = g_object_ref (mount_operation);
if (cancellable)
data->cancellable = g_object_ref (cancellable);
@@ -1658,7 +1660,8 @@ g_daemon_file_stop_mountable (GFile *file,
data = g_new0 (AsyncMountOp, 1);
data->flags = flags;
- data->mount_operation = g_object_ref (mount_operation);
+ if (mount_operation)
+ data->mount_operation = g_object_ref (mount_operation);
if (cancellable)
data->cancellable = g_object_ref (cancellable);
@@ -1743,7 +1746,8 @@ g_daemon_file_eject_mountable_with_operation (GFile *file,
data = g_new0 (AsyncMountOp, 1);
data->flags = flags;
- data->mount_operation = g_object_ref (mount_operation);
+ if (mount_operation)
+ data->mount_operation = g_object_ref (mount_operation);
if (cancellable)
data->cancellable = g_object_ref (cancellable);
@@ -1846,7 +1850,8 @@ g_daemon_file_unmount_mountable_with_operation (GFile *file,
data = g_new0 (AsyncMountOp, 1);
data->flags = flags;
- data->mount_operation = g_object_ref (mount_operation);
+ if (mount_operation)
+ data->mount_operation = g_object_ref (mount_operation);
if (cancellable)
data->cancellable = g_object_ref (cancellable);