Package: gvfs / 1.46.2-1

dont-crash-on-null-job.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From: Michael Terry <mterry@ubuntu.com>
Date: Wed, 11 Apr 2012 16:01:32 -0400
Subject: Don't try to announce the finish of a NULL job.

Origin: vendor, Ubuntu
Bug-Ubuntu: LP #345754, #838464
---
 daemon/gvfschannel.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/daemon/gvfschannel.c b/daemon/gvfschannel.c
index cc07988..c0c26da 100644
--- a/daemon/gvfschannel.c
+++ b/daemon/gvfschannel.c
@@ -612,7 +612,8 @@ send_reply_cb (GObject *source_object,
 
   job = channel->priv->current_job;
   channel->priv->current_job = NULL;
-  g_vfs_job_emit_finished (job);
+  if (job)
+    g_vfs_job_emit_finished (job);
 
   class = G_VFS_CHANNEL_GET_CLASS (channel);
   
@@ -633,7 +634,7 @@ send_reply_cb (GObject *source_object,
     }
   /* Start queued request or readahead */
   else if (!start_queued_request (channel) &&
-	   class->readahead)
+	   class->readahead && job)
     {
       /* No queued requests, maybe we want to do a readahead call */
       channel->priv->current_job = class->readahead (channel, job);