From cc88e0d41f672cef47c39fb84078b92a09900091 Mon Sep 17 00:00:00 2001 From: Teufelchen1 Date: Mon, 8 Apr 2024 13:52:17 +0200 Subject: [PATCH] pkg/nimble: Ignore bogus adv. during scan --- pkg/nimble/scanlist/nimble_scanlist.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/nimble/scanlist/nimble_scanlist.c b/pkg/nimble/scanlist/nimble_scanlist.c index e8674ecb448a..773fc7987688 100644 --- a/pkg/nimble/scanlist/nimble_scanlist.c +++ b/pkg/nimble/scanlist/nimble_scanlist.c @@ -71,7 +71,12 @@ void nimble_scanlist_update(uint8_t type, const ble_addr_t *addr, const uint8_t *ad, size_t len) { assert(addr); - assert(len <= BLE_ADV_PDU_LEN); + + /* Ignore bogus advertisements */ + if (len > BLE_ADV_PDU_LEN) { + assert(0); + return; + } uint32_t now = (uint32_t)ztimer_now(ZTIMER_USEC); nimble_scanlist_entry_t *e = _find(addr);