From bb977042e5c2249eb7a848558e32f328d5efa821 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Mon, 30 Jan 2017 16:43:37 +0100 Subject: [PATCH] nimble/hci: Fix passing uninitialized data In ble_hs_hci_evt_le_dir_adv_rpt function desc.length_data was passed uninitialized to ble_gap_rx_adv_report. While it shouldn't be access if desc.data is NULL it is better to just initialize it to 0. X-Original-Commit: 4e7d583466b6bd3917e984eb47d8b06f2e20c353 --- nimble/host/src/ble_hs_hci_evt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/nimble/host/src/ble_hs_hci_evt.c b/nimble/host/src/ble_hs_hci_evt.c index 4305124be..d6229505c 100644 --- a/nimble/host/src/ble_hs_hci_evt.c +++ b/nimble/host/src/ble_hs_hci_evt.c @@ -434,6 +434,7 @@ ble_hs_hci_evt_le_dir_adv_rpt(uint8_t subevent, uint8_t *data, int len) /* Data fields not present in a direct advertising report. */ desc.data = NULL; + desc.length_data = 0; for (i = 0; i < num_reports; i++) { suboff = 0;