diff options
author | Ross Lagerwall <rosslagerwall@gmail.com> | 2015-03-01 16:47:45 +0000 |
---|---|---|
committer | Ross Lagerwall <rosslagerwall@gmail.com> | 2015-03-11 23:09:13 +0000 |
commit | d603ba4983d249349e7384f31fd2ed921e65e869 (patch) | |
tree | ef33c25b16b498e1c26db22c847eaf4984387695 /daemon/gvfsftptask.c | |
parent | c0bd3138a60b2a389ac99540ac3bfecb700ef0ff (diff) | |
download | gvfs-d603ba4983d249349e7384f31fd2ed921e65e869.tar.gz |
ftp: Prevent segfault when unmounting
If a job is waiting for a connection in
g_vfs_ftp_task_acquire_connection and the backend is force unmounted,
the queue is freed, and the function neither gets a connection nor
sets an error message which causes an issue later.
To fix this, set an error message if the queue is freed.
https://bugzilla.gnome.org/show_bug.cgi?id=653042
Diffstat (limited to 'daemon/gvfsftptask.c')
-rw-r--r-- | daemon/gvfsftptask.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/daemon/gvfsftptask.c b/daemon/gvfsftptask.c index d78e0d5f..c70262b1 100644 --- a/daemon/gvfsftptask.c +++ b/daemon/gvfsftptask.c @@ -269,7 +269,11 @@ g_vfs_ftp_task_acquire_connection (GVfsFtpTask *task) break; } } + if (!ftp->queue) + task->error = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_NOT_MOUNTED, + _("Backend currently unmounting")); g_mutex_unlock (&ftp->mutex); + out_unlocked: g_cancellable_disconnect (task->cancellable, id); |