From 8ce94d5bd3765c0f7973cf4c0f2335d67e69891b Mon Sep 17 00:00:00 2001 From: lucashutchinson Date: Thu, 2 Mar 2017 16:41:03 +1300 Subject: [PATCH] ble: Fix ble_adv data truncation Fixed issue with ble_adv data being truncated after the 31st octet due to an incorrect length passed in a memcpy. Merges #389 https://github.com/espressif/esp-idf/pull/389 --- components/bt/bluedroid/btc/profile/std/gap/btc_gap_ble.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/bt/bluedroid/btc/profile/std/gap/btc_gap_ble.c b/components/bt/bluedroid/btc/profile/std/gap/btc_gap_ble.c index 8fea801b0a..9e158c592e 100644 --- a/components/bt/bluedroid/btc/profile/std/gap/btc_gap_ble.c +++ b/components/bt/bluedroid/btc/profile/std/gap/btc_gap_ble.c @@ -476,8 +476,7 @@ static void btc_search_callback(tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH *p_data param.scan_rst.ble_addr_type = p_data->inq_res.ble_addr_type; param.scan_rst.ble_evt_type = p_data->inq_res.ble_evt_type; param.scan_rst.flag = p_data->inq_res.flag; - memcpy(param.scan_rst.ble_adv, p_data->inq_res.p_eir, - ESP_BLE_ADV_DATA_LEN_MAX); + memcpy(param.scan_rst.ble_adv, p_data->inq_res.p_eir, sizeof(param.scan_rst.ble_adv)); break; } case BTA_DM_INQ_CMPL_EVT: { -- 2.40.0