mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/protocomm_nimble_allocation' into 'master'
Fix for potential allocation bug in protocomm_nimble.c Closes IDFGH-6005 See merge request espressif/esp-idf!15669
This commit is contained in:
commit
28db922cfd
@ -319,6 +319,12 @@ gatt_svr_chr_access(uint16_t conn_handle, uint16_t attr_handle,
|
||||
return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
|
||||
|
||||
case BLE_GATT_ACCESS_OP_WRITE_CHR:
|
||||
/* If empty packet is received, return */
|
||||
if (ctxt->om->om_len == 0) {
|
||||
ESP_LOGD(TAG,"Empty packet");
|
||||
return 0;
|
||||
}
|
||||
|
||||
uuid = (uint8_t *) calloc(BLE_UUID128_VAL_LENGTH, sizeof(uint8_t));
|
||||
if (!uuid) {
|
||||
ESP_LOGE(TAG, "Error allocating memory for 128 bit UUID");
|
||||
|
Loading…
Reference in New Issue
Block a user