mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
fix(ble_mesh): fixed BLE-Mesh NimBLE extended-adv reassembly buffer overflow on COMPLETE fragment
(cherry picked from commit 1b22467f63)
Co-authored-by: luoxu <luoxu@espressif.com>
This commit is contained in:
@@ -538,6 +538,10 @@ int disc_cb(struct ble_gap_event *event, void *arg)
|
||||
switch (desc->data_status) {
|
||||
case BLE_GAP_EXT_ADV_DATA_STATUS_COMPLETE:
|
||||
if (adv_report_cache.adv_data_len) {
|
||||
if (adv_report_cache.adv_data_len + desc->length_data > BLE_MESH_GAP_ADV_MAX_LEN) {
|
||||
memset(&adv_report_cache, 0, sizeof(adv_report_cache));
|
||||
return false;
|
||||
}
|
||||
memcpy(adv_report_cache.adv_data + adv_report_cache.adv_data_len,
|
||||
desc->data, desc->length_data);
|
||||
adv_report_cache.adv_data_len += desc->length_data;
|
||||
|
||||
Reference in New Issue
Block a user