All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] client/player: Fix crashes accessing metadata
@ 2023-05-11  0:01 Luiz Augusto von Dentz
  2023-05-11  0:01 ` [PATCH BlueZ 2/2] shared/bap: Fix not sending ASE Receiver Stop Ready Luiz Augusto von Dentz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2023-05-11  0:01 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If metadata is not set the respective iovec is left NULL so it needs to
be checked before accessing its fields.
---
 client/player.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/client/player.c b/client/player.c
index f055ff941569..091d7005f42a 100644
--- a/client/player.c
+++ b/client/player.c
@@ -1743,7 +1743,7 @@ static void append_properties(DBusMessageIter *iter,
 					DBUS_TYPE_BYTE, &cfg->caps->iov_base,
 					cfg->caps->iov_len);
 
-	if (cfg->meta->iov_len) {
+	if (cfg->meta && cfg->meta->iov_len) {
 		g_dbus_dict_append_basic_array(&dict, DBUS_TYPE_STRING, &meta,
 				DBUS_TYPE_BYTE, &cfg->meta->iov_base,
 				cfg->meta->iov_len);
@@ -1850,7 +1850,8 @@ static DBusMessage *endpoint_select_properties_reply(struct endpoint *ep,
 	cfg->target_latency = preset->target_latency;
 
 	/* Copy metadata */
-	iov_append(&cfg->meta, cfg->ep->meta->iov_base, cfg->ep->meta->iov_len);
+	if (ep->meta)
+		iov_append(&cfg->meta, ep->meta->iov_base, ep->meta->iov_len);
 
 	if (preset->qos.phy)
 		/* Set QoS parameters */
-- 
2.40.0


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

end of thread, other threads:[~2023-05-12 20:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-11  0:01 [PATCH BlueZ 1/2] client/player: Fix crashes accessing metadata Luiz Augusto von Dentz
2023-05-11  0:01 ` [PATCH BlueZ 2/2] shared/bap: Fix not sending ASE Receiver Stop Ready Luiz Augusto von Dentz
2023-05-11  2:21 ` [BlueZ,1/2] client/player: Fix crashes accessing metadata bluez.test.bot
2023-05-12 20:40 ` [PATCH BlueZ 1/2] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.