File: dont-crash-on-null-job.patch

package info (click to toggle)
gvfs 1.58.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,452 kB
  • sloc: ansic: 105,955; python: 1,461; xml: 944; sh: 146; makefile: 54
file content (40 lines) | stat: -rw-r--r-- 1,464 bytes parent folder | download | duplicates (2)
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
34
35
36
37
38
39
40
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.

TODO: It isn't clear whether this is still needed. According to a
2013-11-04 comment upstream: "This is not reproducible on current git
master so it must have been fixed up in the meantime."

Origin: vendor, Ubuntu
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=576731
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/345754
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/838464
Forwarded: https://bugzilla.gnome.org/show_bug.cgi?id=576731#c5
---
 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);