mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-10-30 09:13:31 +00:00
mesh: Fix tx seg buffer with NULL pointer reference
Bluetooth: Mesh: Fix tx seg buffer with NULL pointer reference Fix tx seg buffer with NULL pointer reference if enable mesh friendly this is port of 9cc884a0d3c7a8ac4ddf476d714435f5a52e2016
This commit is contained in:
committed by
Łukasz Rymanowski
parent
052a034b4a
commit
8be692f6bb
@@ -530,6 +530,8 @@ static int send_seg(struct bt_mesh_net_tx *net_tx, struct os_mbuf *sdu,
|
||||
memcpy(buf, net_buf_simple_pull_mem(sdu, len), len);
|
||||
BT_DBG("seg %u: %s", seg_o, bt_hex(buf, len));
|
||||
|
||||
tx->seg[seg_o] = buf;
|
||||
|
||||
if (IS_ENABLED(CONFIG_BT_MESH_FRIEND)) {
|
||||
enum bt_mesh_friend_pdu_type type;
|
||||
|
||||
@@ -550,11 +552,10 @@ static int send_seg(struct bt_mesh_net_tx *net_tx, struct os_mbuf *sdu,
|
||||
* out through the Friend Queue.
|
||||
*/
|
||||
k_mem_slab_free(&segs, &buf);
|
||||
continue;
|
||||
tx->seg[seg_o] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
tx->seg[seg_o] = buf;
|
||||
}
|
||||
|
||||
/* This can happen if segments only went into the Friend Queue */
|
||||
|
||||
Reference in New Issue
Block a user