Skip to content

Commit

Permalink
Merge branch 'bluedroid/memory_full_v5.1' into 'release/v5.1'
Browse files Browse the repository at this point in the history
fix (Bluedroid) : Fix the memory corruption issue(v5.1)

See merge request espressif/esp-idf!25181
  • Loading branch information
Isl2017 committed Aug 14, 2023
2 parents 3fd0eff + 5d49509 commit 25876e8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/bt/host/bluedroid/hci/hci_hal_h4.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ ble_hs_hci_rx_evt(uint8_t *hci_ev, void *arg)
}
uint16_t len = hci_ev[1] + 3;
uint8_t *data = (uint8_t *)malloc(len);
assert(data != NULL);
data[0] = 0x04;
memcpy(&data[1], hci_ev, len - 1);
ble_hci_trans_buf_free(hci_ev);
Expand All @@ -614,6 +615,7 @@ ble_hs_rx_data(struct os_mbuf *om, void *arg)
{
uint16_t len = om->om_len + 1;
uint8_t *data = (uint8_t *)malloc(len);
assert(data != NULL);
data[0] = 0x02;
os_mbuf_copydata(om, 0, len - 1, &data[1]);
host_recv_pkt_cb(data, len);
Expand Down

0 comments on commit 25876e8

Please sign in to comment.