diff mbox series

[v1] obex: Check for supported features bit value for legacy server

Message ID 20241111123125.2034898-1-quic_amisjain@quicinc.com
State New
Headers show
Series [v1] obex: Check for supported features bit value for legacy server | expand

Commit Message

Amisha Jain Nov. 11, 2024, 12:31 p.m. UTC
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 mbox series

Patch

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,