diff mbox series

[v1] obex: Add null check for data pointer for PCE

Message ID 20250228062554.3102800-1-quic_amisjain@quicinc.com
State New
Headers show
Series [v1] obex: Add null check for data pointer for PCE | expand

Commit Message

Amisha Jain Feb. 28, 2025, 6:25 a.m. UTC
Incase of legacy server, when the 'supported fetures bit' attribute
is NULL, Add the check to avoid any invalid memory access.

---
 obexd/client/pbap.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/obexd/client/pbap.c b/obexd/client/pbap.c
index 09d3fd425..48a2de650 100644
--- a/obexd/client/pbap.c
+++ b/obexd/client/pbap.c
@@ -1235,6 +1235,9 @@  static void *pbap_supported_features(struct obc_session *session)
 	data = obc_session_get_attribute(session,
 					SDP_ATTR_PBAP_SUPPORTED_FEATURES);
 
+	if (!data)
+		return NULL;
+
 	features = *(uint32_t *) data;
 	if (!features)
 		return NULL;