From 140c8d0cd95523815d42dbca10ef9457780f6636 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 11 Jan 2022 21:33:35 +0100 Subject: [PATCH] bluez5: handle missing device and adapter in quirks When the device or adapter is NULL, skip the quirk checks instead of crashing. Fixes https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/155 --- spa/plugins/bluez5/quirks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spa/plugins/bluez5/quirks.c b/spa/plugins/bluez5/quirks.c index 217bb61f6..16a8ebaa9 100644 --- a/spa/plugins/bluez5/quirks.c +++ b/spa/plugins/bluez5/quirks.c @@ -332,7 +332,7 @@ int spa_bt_quirks_get_features(const struct spa_bt_quirks *this, } /* Adapter */ - if (this->adapter_rules) { + if (this->adapter_rules && adapter) { uint32_t no_features = 0; int nitems = 0; char vendor_id[64], product_id[64], address[64]; @@ -357,7 +357,7 @@ int spa_bt_quirks_get_features(const struct spa_bt_quirks *this, } /* Device */ - if (this->device_rules) { + if (this->device_rules && device) { uint32_t no_features = 0; int nitems = 0; char vendor_id[64], product_id[64], version_id[64], address[64];