public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Brabec <sbrabec@suse.cz>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH] bluez-gnome: Fix crash on pairing request of known rfcomm device
Date: Thu, 10 Sep 2009 17:10:15 +0200	[thread overview]
Message-ID: <1252595415.3430.17.camel@hammer.suse.cz> (raw)

Attached patch fixes crash after access attempt to the device configured
in rfcomm.conf, but not yet paired.

How to reproduce:

1. Configure an unknown RFCOMM device that requires authentication in
   rfcomm.conf (e. g. mobile phone).
2. run pppd on /dev/rfcomm1

Behavior:
- Pairing request on mobile phone
- Crash of bluetooth-applet on desktop

The patch fixes only the crash, not the error completely (at least in
version 1.8). Behavior after the fix:
- Pairing request on mobile phone, then ask for PIN
- No reaction on desktop

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>

Index: bluez-gnome-1.8/common/bluetooth-client.c
===================================================================
--- bluez-gnome-1.8.orig/common/bluetooth-client.c
+++ bluez-gnome-1.8/common/bluetooth-client.c
@@ -330,7 +330,7 @@ static void add_device(DBusGProxy *adapt
 		name = value ? g_value_get_string(value) : NULL;
 
 		value = g_hash_table_lookup(hash, "Class");
-		type = class_to_type(g_value_get_uint(value));
+		type = value ? class_to_type(g_value_get_uint(value)) : BLUETOOTH_TYPE_ANY;
 
 		value = g_hash_table_lookup(hash, "Icon");
 		icon = value ? g_value_get_string(value) : "bluetooth";

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                          e-mail: sbrabec@suse.cz
Lihovarská 1060/12           tel: +420 284 028 966, +49 911 740538747
190 00 Praha 9                                  fax: +420 284 028 951
Czech Republic                                    http://www.suse.cz/


             reply	other threads:[~2009-09-10 15:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-10 15:10 Stanislav Brabec [this message]
2009-09-10 15:21 ` [PATCH] bluez-gnome: Fix crash on pairing request of known rfcomm device Bastien Nocera

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1252595415.3430.17.camel@hammer.suse.cz \
    --to=sbrabec@suse.cz \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox