From: Iulia Tanasescu <iulia.tanasescu@nxp.com>
To: linux-bluetooth@vger.kernel.org
Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com,
andrei.istodorescu@nxp.com, luiz.dentz@gmail.com,
Iulia Tanasescu <iulia.tanasescu@nxp.com>
Subject: [PATCH BlueZ 1/2] btio: Set correct length for getsockopt
Date: Fri, 17 Jan 2025 16:06:31 +0200 [thread overview]
Message-ID: <20250117140632.120501-2-iulia.tanasescu@nxp.com> (raw)
In-Reply-To: <20250117140632.120501-1-iulia.tanasescu@nxp.com>
When calling getsockopt for BT_ISO_BASE, this initializes the length
argument to the maximum size of the buffer where the bytes are placed.
This fixes the fact that, on a Broadcast Sink, if the BASE discovered
from a Broadcast Source exceeds a certain length, the bytes will be
incompletely read, causing issues when parsing the LTVs.
---
btio/btio.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/btio/btio.c b/btio/btio.c
index 2d277e409..f32fbd509 100644
--- a/btio/btio.c
+++ b/btio/btio.c
@@ -5,7 +5,7 @@
*
* Copyright (C) 2009-2010 Marcel Holtmann <marcel@holtmann.org>
* Copyright (C) 2009-2010 Nokia Corporation
- * Copyright 2023-2024 NXP
+ * Copyright 2023-2025 NXP
*
*
*/
@@ -1654,6 +1654,7 @@ static gboolean iso_get(int sock, GError **err, BtIOOption opt1, va_list args)
return FALSE;
}
+ len = BASE_MAX_LENGTH;
if (getsockopt(sock, SOL_BLUETOOTH, BT_ISO_BASE,
&base.base, &len) < 0) {
ERROR_FAILED(err, "getsockopt(BT_ISO_BASE)", errno);
--
2.43.0
next prev parent reply other threads:[~2025-01-17 14:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-17 14:06 [PATCH BlueZ 0/2] shared/bap: Fix BASE parsing Iulia Tanasescu
2025-01-17 14:06 ` Iulia Tanasescu [this message]
2025-01-17 15:06 ` bluez.test.bot
2025-01-17 14:06 ` [PATCH BlueZ 2/2] shared/bap: Append extra L3 LTVs to BIS config Iulia Tanasescu
2025-01-17 18:10 ` [PATCH BlueZ 0/2] shared/bap: Fix BASE parsing patchwork-bot+bluetooth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250117140632.120501-2-iulia.tanasescu@nxp.com \
--to=iulia.tanasescu@nxp.com \
--cc=andrei.istodorescu@nxp.com \
--cc=claudia.rosu@nxp.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=mihai-octavian.urzica@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.