You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2024/09/24 11:48:37 UTC
(mynewt-nimble) 01/03: nimble/host: Fix legacy advertising report event validation
This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit 3b7a32ea09a3bffaab831ee0ab193a2375fc4df6
Author: Szymon Janc <sz...@codecoup.pl>
AuthorDate: Mon Sep 23 15:57:46 2024 +0200
nimble/host: Fix legacy advertising report event validation
If event contained more than one report it would likely failed
validation due to invalid data comparison.
---
nimble/host/src/ble_hs_hci_evt.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/nimble/host/src/ble_hs_hci_evt.c b/nimble/host/src/ble_hs_hci_evt.c
index 3cb5f9858..181a2fb48 100644
--- a/nimble/host/src/ble_hs_hci_evt.c
+++ b/nimble/host/src/ble_hs_hci_evt.c
@@ -479,15 +479,13 @@ ble_hs_hci_evt_le_adv_rpt_first_pass(const void *data, unsigned int len)
rpt = data;
- len -= sizeof(*rpt) + 1;
- data += sizeof(rpt) + 1;
-
if (rpt->data_len > len) {
return BLE_HS_ECONTROLLER;
}
- len -= rpt->data_len;
- data += rpt->data_len;
+ /* extra byte for RSSI after adv data */
+ len -= sizeof(*rpt) + 1 + rpt->data_len;
+ data += sizeof(*rpt) + 1 + rpt->data_len;
}
/* Make sure length was correct */