From: Prathibha Madugonde <prathibha.madugonde@oss.qualcomm.com>
To: linux-bluetooth@vger.kernel.org
Cc: luiz.dentz@gmail.com, quic_mohamull@quicinc.com,
quic_hbandi@quicinc.com, quic_anubhavg@quicinc.com
Subject: [PATCH BlueZ v1] shared/rap: Fix step payload pointer in parse_step
Date: Tue, 23 Jun 2026 16:41:12 +0530 [thread overview]
Message-ID: <20260623111112.1332742-1-prathm@qti.qualcomm.com> (raw)
From: Prathibha Madugonde <prathibha.madugonde@oss.qualcomm.com>
util_iov_pull advances iov_base before returning the new pointer, so
mode_iov.iov_base was set to the start of the *next* step's data.
Every step was therefore parsed using its successor's bytes.
Switch to util_iov_pull_mem which saves the original base, advances
iov, and returns the pre-advance pointer — correctly pointing to the
current step's payload.
---
src/shared/rap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/rap.c b/src/shared/rap.c
index ecf7df5a7..dfb272d3a 100644
--- a/src/shared/rap.c
+++ b/src/shared/rap.c
@@ -2326,7 +2326,7 @@ static bool parse_step(struct bt_rap *rap, struct iovec *iov,
DBG(rap, " Step %u: mode=%u payload_len=%zu",
step_idx, step_mode, step_payload_len);
- payload = util_iov_pull(iov, step_payload_len);
+ payload = util_iov_pull_mem(iov, step_payload_len);
if (!payload) {
DBG(rap, "Insufficient data for step %u payload "
"(need %zu, have %zu)",
--
2.34.1
next reply other threads:[~2026-06-23 11:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-23 11:11 Prathibha Madugonde [this message]
2026-06-24 19:31 ` [PATCH BlueZ v1] shared/rap: Fix step payload pointer in parse_step 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=20260623111112.1332742-1-prathm@qti.qualcomm.com \
--to=prathibha.madugonde@oss.qualcomm.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=quic_anubhavg@quicinc.com \
--cc=quic_hbandi@quicinc.com \
--cc=quic_mohamull@quicinc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox