Linux bluetooth development
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: linux-bluetooth@vger.kernel.org
Subject: [BlueZ] avrcp: Fix media/folder name not being set
Date: Mon, 17 Aug 2026 10:23:07 +0200	[thread overview]
Message-ID: <20260817082315.4090729-1-hadess@hadess.net> (raw)

*namelen was used before being set.

Fixes: bd8989620ed6 ("avrcp: Fix Out-of-Bounds Read in AVRCP GetFolderItems parsing")
---
 profiles/audio/avrcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 23e959c76917..028c1c254b82 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -2623,7 +2623,7 @@ static gboolean parse_media_name(uint8_t *operands, uint16_t len,
 	namesize = MIN(get_be16(&operands[name_len_offset]),
 			len - name_len_offset - 2);
 	namesize = MIN(namesize, NAME_MAX_LEN - 1);
-	if (*namelen > 0) {
+	if (namesize > 0) {
 		if (len < name_len_offset + 2 + namesize)
 			return FALSE;
 		memcpy(name, &operands[name_len_offset + 2], namesize);
-- 
2.55.0


             reply	other threads:[~2026-08-17  9:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17  8:23 Bastien Nocera [this message]
2026-08-17 10:54 ` [BlueZ] avrcp: Fix media/folder name not being set bluez.test.bot

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=20260817082315.4090729-1-hadess@hadess.net \
    --to=hadess@hadess.net \
    --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