Skip to content

Commit 82083a9

Browse files
trond-snekvikjhedberg
authored andcommitted
Bluetooth: Mesh: net_key_status only pull one key idx
Fixes bug where the config client's net_key_status handler would attempt to pull two key indexes from a message which only holds one. Fixes #24601. Signed-off-by: Trond Einar Snekvik <[email protected]>
1 parent 341681f commit 82083a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/bluetooth/mesh/cfg_cli.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ static void net_key_status(struct bt_mesh_model *model,
152152
struct net_buf_simple *buf)
153153
{
154154
struct net_key_param *param;
155-
u16_t net_idx, app_idx;
155+
u16_t net_idx;
156156
u8_t status;
157157

158158
BT_DBG("net_idx 0x%04x app_idx 0x%04x src 0x%04x len %u: %s",
@@ -165,7 +165,7 @@ static void net_key_status(struct bt_mesh_model *model,
165165
}
166166

167167
status = net_buf_simple_pull_u8(buf);
168-
key_idx_unpack(buf, &net_idx, &app_idx);
168+
net_idx = net_buf_simple_pull_le16(buf) & 0xfff;
169169

170170
param = cli->op_param;
171171
if (param->net_idx != net_idx) {

0 commit comments

Comments
 (0)