Linux bluetooth development
 help / color / mirror / Atom feed
From: Roland Schober <rolandschober1968@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Roland Schober <rolandschober1968@gmail.com>
Subject: [PATCH BlueZ v2 5/6] shared/bap: Fix reading beyond the Program Info
Date: Mon, 23 Nov 2026 23:23:14 +0100	[thread overview]
Message-ID: <20261123222315.223450-6-rolandschober1968@gmail.com> (raw)
In-Reply-To: <20261123222315.223450-1-rolandschober1968@gmail.com>

The Program Info metadata is printed with "%*s", which sets a minimum
field width and not a limit, so the string is read up to the next zero
octet, beyond the metadata and possibly beyond the packet.

Print it with "%.*s" like the Program Info URI.

Fixes: 6d4491649e06 ("shared/bap: Add debug helpers")
Assisted-by: Claude:claude-fable-5-2
---
 src/shared/bap-debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/shared/bap-debug.c b/src/shared/bap-debug.c
index b4352bdd3..772bd0a71 100644
--- a/src/shared/bap-debug.c
+++ b/src/shared/bap-debug.c
@@ -501,7 +501,7 @@ static void ase_debug_program_info(const uint8_t *data, uint8_t len,
 		goto done;
 	}
 
-	util_debug(func, user_data, "Program Info: %*s", len, str);
+	util_debug(func, user_data, "Program Info: %.*s", len, str);
 
 done:
 	if (frame.iov_len)
-- 
2.47.3


  parent reply	other threads:[~2026-11-23 22:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 22:23 [PATCH BlueZ v2 0/6] monitor: Fix reads beyond advertising data Roland Schober
2026-11-23 22:23 ` [PATCH BlueZ v2 1/6] monitor: Fix overflow of the name buffer in print_eir Roland Schober
2026-11-23 22:23 ` [PATCH BlueZ v2 2/6] monitor: Fix reading Flags beyond empty AD structures Roland Schober
2026-11-23 22:23 ` [PATCH BlueZ v2 3/6] monitor: Fix reading beyond a short Mesh Beacon Roland Schober
2026-11-23 22:23 ` [PATCH BlueZ v2 4/6] monitor: Fix reading beyond the Apple manufacturer data Roland Schober
2026-11-23 22:23 ` Roland Schober [this message]
2026-11-23 22:23 ` [PATCH BlueZ v2 6/6] monitor: Fix decoding of Public Broadcast Announcements Roland Schober

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=20261123222315.223450-6-rolandschober1968@gmail.com \
    --to=rolandschober1968@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox