summaryrefslogtreecommitdiff
path: root/extra/totem/fix_crash.patch
blob: 08409696c4e59098823b5eaa795be70474969bd6 (plain)
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
From cee6399c1de27e5ccae35975aaae4fd7cfa40c2c Mon Sep 17 00:00:00 2001
From: Marcel van den Hof <marcelvdh@gmail.com>
Date: Sun, 29 May 2011 23:45:36 +0100
Subject: [PATCH] Fix segfault in Bemused plugin

If bluetoothd is not running sdp_connect() returns a null value which
will cause the plugin to segfault.

This patch adds a check for a possible null value from sdp_connect().
---
 src/plugins/bemused/totem-bemused.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/plugins/bemused/totem-bemused.c b/src/plugins/bemused/totem-bemused.c
index 584b4d3..c51a0ee 100644
--- a/src/plugins/bemused/totem-bemused.c
+++ b/src/plugins/bemused/totem-bemused.c
@@ -655,7 +655,8 @@ sdp_svc_add_spp(u_int8_t port,
 
 	/* Connect to the local SDP server, register the service record */
 	session = sdp_connect (BDADDR_ANY, BDADDR_LOCAL, 0);
-	sdp_record_register (session, &record, 0);
+	if (session != NULL)	
+		sdp_record_register (session, &record, 0);
 
 	/* Cleanup */
 	sdp_data_free (channel);
-- 
1.7.5.2