From 483831e514ae9db61792d17dff158b8601cfe6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20H=C4=83loiu?= Date: Sat, 29 Jan 2022 21:13:45 +0000 Subject: [PATCH] bluez: handle non-hexadecimal XAPL version strings --- spa/plugins/bluez5/backend-native.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spa/plugins/bluez5/backend-native.c b/spa/plugins/bluez5/backend-native.c index 7fac93645..effa8b14a 100644 --- a/spa/plugins/bluez5/backend-native.c +++ b/spa/plugins/bluez5/backend-native.c @@ -705,7 +705,6 @@ static bool rfcomm_hfp_ag(struct rfcomm *rfcomm, char* buf) unsigned int indicator_value; int xapl_vendor; int xapl_product; - int xapl_version; int xapl_features; if (sscanf(buf, "AT+BRSF=%u", &features) == 1) { @@ -889,7 +888,7 @@ static bool rfcomm_hfp_ag(struct rfcomm *rfcomm, char* buf) rfcomm_send_reply(rfcomm, "OK"); } else if (sscanf(buf, "AT+BIEV=%u,%u", &indicator, &indicator_value) == 2) { process_hfp_hf_indicator(rfcomm, indicator, indicator_value); - } else if (sscanf(buf, "AT+XAPL=%04x-%04x-%04x,%u", &xapl_vendor, &xapl_product, &xapl_version, &xapl_features) == 4) { + } else if (sscanf(buf, "AT+XAPL=%04x-%04x-%*[^,],%u", &xapl_vendor, &xapl_product, &xapl_features) == 3) { if (xapl_features & SPA_BT_HFP_HF_XAPL_FEATURE_BATTERY_REPORTING) { /* claim, that we support battery status reports */ rfcomm_send_reply(rfcomm, "+XAPL=iPhone,%u", SPA_BT_HFP_HF_XAPL_FEATURE_BATTERY_REPORTING);