[pulseaudio-commits] 2 commits - src/modules

Tanu Kaskinen tanuk at kemper.freedesktop.org
Fri Nov 22 08:41:03 PST 2013


 src/modules/bluetooth/bluez5-util.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit b705e38a795cba0b6ef8c611ed78fa884185025d
Author: João Paulo Rechi Vita <jprvita at gmail.com>
Date:   Wed Nov 20 18:21:36 2013 -0300

    bluetooth: Fix crash in pa_bluetooth_discovery_get_device_by_address()
    
    We need to check if the device information is valid first, so we don't
    pass invalid strings to pa_streq().

diff --git a/src/modules/bluetooth/bluez5-util.c b/src/modules/bluetooth/bluez5-util.c
index d2893c0..c7fb6ae 100644
--- a/src/modules/bluetooth/bluez5-util.c
+++ b/src/modules/bluetooth/bluez5-util.c
@@ -395,8 +395,8 @@ pa_bluetooth_device* pa_bluetooth_discovery_get_device_by_address(pa_bluetooth_d
     pa_assert(local);
 
     while ((d = pa_hashmap_iterate(y->devices, &state, NULL)))
-        if (pa_streq(d->address, remote) && pa_streq(d->adapter->address, local))
-            return d->device_info_valid == 1 ? d : NULL;
+        if (d->device_info_valid == 1 && pa_streq(d->address, remote) && pa_streq(d->adapter->address, local))
+            return d;
 
     return NULL;
 }

commit d8fb09b56726e626086f8d44e9221c9129b4fa36
Author: João Paulo Rechi Vita <jprvita at gmail.com>
Date:   Wed Nov 20 18:21:35 2013 -0300

    bluetooth: Check adapter address to set device_info_valid
    
    If the adapter object has no address information the device information
    should be marked as invalid.

diff --git a/src/modules/bluetooth/bluez5-util.c b/src/modules/bluetooth/bluez5-util.c
index c8ff219..d2893c0 100644
--- a/src/modules/bluetooth/bluez5-util.c
+++ b/src/modules/bluetooth/bluez5-util.c
@@ -820,8 +820,8 @@ static void parse_interfaces_and_properties(pa_bluetooth_discovery *y, DBusMessa
 
         if (!d->adapter && d->adapter_path) {
             d->adapter = pa_hashmap_get(d->discovery->adapters, d->adapter_path);
-            if (!d->adapter) {
-                pa_log_error("Device %s is child of nonexistent adapter %s", d->path, d->adapter_path);
+            if (!d->adapter || !d->adapter->address) {
+                pa_log_error("Device %s is child of nonexistent or corrupted adapter %s", d->path, d->adapter_path);
                 set_device_info_valid(d, -1);
             } else
                 set_device_info_valid(d, 1);



More information about the pulseaudio-commits mailing list