From ee99693f777e5dd1b4ad440f2e4fea4cd2de27e7 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 25 Mar 2021 17:38:45 +0100 Subject: [PATCH] bluez5: check for NULL info before accessing it --- spa/plugins/bluez5/backend-native.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spa/plugins/bluez5/backend-native.c b/spa/plugins/bluez5/backend-native.c index 17ad3e83d..d4e0da266 100644 --- a/spa/plugins/bluez5/backend-native.c +++ b/spa/plugins/bluez5/backend-native.c @@ -1623,7 +1623,8 @@ static int parse_headset_roles(struct impl *backend, const struct spa_dict *info char role_name[256]; enum spa_bt_profile profiles = SPA_BT_PROFILE_NULL; - if ((str = spa_dict_lookup(info, PROP_KEY_HEADSET_ROLES)) == NULL) + if (info == NULL || + (str = spa_dict_lookup(info, PROP_KEY_HEADSET_ROLES)) == NULL) goto fallback; spa_json_init(&it, str, strlen(str));