Skip to content

Commit ba0b8dc

Browse files
committed
Merge branch 'bluedroid/memory_full' into 'master'
fix (Bluedroid) : Fix the memory corruption issue See merge request espressif/esp-idf!24905
2 parents 84f9e5e + b250e59 commit ba0b8dc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

components/bt/host/bluedroid/hci/hci_hal_h4.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ ble_hs_hci_rx_evt(uint8_t *hci_ev, void *arg)
600600
}
601601
uint16_t len = hci_ev[1] + 3;
602602
uint8_t *data = (uint8_t *)malloc(len);
603+
assert(data != NULL);
603604
data[0] = 0x04;
604605
memcpy(&data[1], hci_ev, len - 1);
605606
ble_hci_trans_buf_free(hci_ev);
@@ -614,6 +615,7 @@ ble_hs_rx_data(struct os_mbuf *om, void *arg)
614615
{
615616
uint16_t len = om->om_len + 1;
616617
uint8_t *data = (uint8_t *)malloc(len);
618+
assert(data != NULL);
617619
data[0] = 0x02;
618620
os_mbuf_copydata(om, 0, len - 1, &data[1]);
619621
host_recv_pkt_cb(data, len);

0 commit comments

Comments
 (0)