public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] obex: Add null check for data pointer for PCE
@ 2025-02-28  6:25 Amisha Jain
  2025-02-28  7:39 ` [v1] " bluez.test.bot
  2025-02-28 15:20 ` [PATCH v1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Amisha Jain @ 2025-02-28  6:25 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: quic_mohamull, quic_hbandi, quic_anubhavg

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 --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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-28 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-28  6:25 [PATCH v1] obex: Add null check for data pointer for PCE Amisha Jain
2025-02-28  7:39 ` [v1] " bluez.test.bot
2025-02-28 15:20 ` [PATCH v1] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox