From cee6399c1de27e5ccae35975aaae4fd7cfa40c2c Mon Sep 17 00:00:00 2001 From: Marcel van den Hof 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