From 486aeafd87bc23bb7969671b06ceaafc124dea84 Mon Sep 17 00:00:00 2001 From: Amisha Jain Date: Mon, 11 Nov 2024 18:01:25 +0530 Subject: [PATCH] obex: Check for supported features bit value for legacy server This fix is required for below PTS testcase: 1. PBAP/PCE/SSM/BV-10-C Description - Verify that the PCE does not share its PbapSupportedFeatures bits with a legacy server. Incase of legacy server, check for 'supported features bit' uint_32_t value instead of directly checking the pointer holding the attribute. As pointer 'data' won't be null as PbapSupportedFeatures attribute is present in SDP record but it's value is zero. --- obexd/client/pbap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/obexd/client/pbap.c b/obexd/client/pbap.c index bc3fdcf9f..09d3fd425 100644 --- a/obexd/client/pbap.c +++ b/obexd/client/pbap.c @@ -1219,6 +1219,7 @@ static void *pbap_supported_features(struct obc_session *session) { const void *data; uint16_t version; + uint32_t features; /* Version */ data = obc_session_get_attribute(session, SDP_ATTR_PFILE_DESC_LIST); @@ -1233,7 +1234,9 @@ static void *pbap_supported_features(struct obc_session *session) /* Supported Feature Bits */ data = obc_session_get_attribute(session, SDP_ATTR_PBAP_SUPPORTED_FEATURES); - if (!data) + + features = *(uint32_t *) data; + if (!features) return NULL; return g_obex_apparam_set_uint32(NULL, SUPPORTED_FEATURES_TAG, -- 2.47.3