diff options
author | Anderson Lizardo <anderson.lizardo@openbossa.org> | 2012-02-14 12:06:01 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-16 15:08:30 +0200 |
commit | d2c09255ef856cd68545ee0cab766a837b47e132 (patch) | |
tree | 8e4e0ccd1cb5cf3445a425e142bc8da1b9b7ec8b /src | |
parent | 793b009033816ec13c571409e6c8d30d8f577979 (diff) | |
download | bluez-d2c09255ef856cd68545ee0cab766a837b47e132.tar.gz |
device: Fix NULL pointer dereference during GATT service discovery
If reverse service discovery for GATT is triggered,
device_browse_primary() is called with a NULL "conn" parameter. This fix
is based on similar code found in device_browse_sdp().
This fixes errors like:
process 871: arguments to dbus_connection_ref() were incorrect,
assertion "connection != NULL" failed in file dbus-connection.c line
2549.
This is normally a bug in some application using the D-Bus library.
process 871: arguments to dbus_connection_get_object_path_data() were
incorrect, assertion "connection != NULL" failed in file
dbus-connection.c line 5639.
This is normally a bug in some application using the D-Bus library.
process 871: arguments to dbus_connection_register_object_path() were
incorrect, assertion "connection != NULL" failed in file
dbus-connection.c line 5461.
This is normally a bug in some application using the D-Bus library.
Diffstat (limited to 'src')
-rw-r--r-- | src/device.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/device.c b/src/device.c index ca7b15bf4..50ab339e7 100644 --- a/src/device.c +++ b/src/device.c @@ -2011,8 +2011,10 @@ int device_browse_primary(struct btd_device *device, DBusConnection *conn, } done: - if (conn) - req->conn = dbus_connection_ref(conn); + if (conn == NULL) + conn = get_dbus_connection(); + + req->conn = dbus_connection_ref(conn); if (msg) { const char *sender = dbus_message_get_sender(msg); |