Skip to contentSkip to conversation

shared/rap: Fix step payload pointer in parse_step

PATCH Applied Prathibha Madugonde 2 participants 2 messages Jun 23 – Jun 24 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 shared/rap: Fix step payload pointer in parse_step

From: Prathibha Madugonde <[email protected]>

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(-)
src/shared/rap.c +1 -1
index ecf7df5a7..dfb272d3a 100644
@@ -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)",
Signature · 1 line
2.34.1
#1 lore raw
This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 11 lines · On Tue, 23 Jun 2026 16:41:12 +0530 you wrote:

From: Prathibha Madugonde <[email protected]>

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.

[...]

Here is the summary with links:
- [BlueZ,v1] shared/rap: Fix step payload pointer in parse_step

    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=40a58272a58f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html