diff --git a/features/FEATURE_BLE/ble/gap/AdvertisingDataParser.h b/features/FEATURE_BLE/ble/gap/AdvertisingDataParser.h index 53fbe23e316..c0559f1bffe 100644 --- a/features/FEATURE_BLE/ble/gap/AdvertisingDataParser.h +++ b/features/FEATURE_BLE/ble/gap/AdvertisingDataParser.h @@ -69,6 +69,11 @@ class AdvertisingDataParser { if (position >= data.size()) { return false; } + + /* early termination of packet, no more meaningful octets */ + if (current_length() == 0) { + return false; + } if (position + current_length() >= data.size()) { return false;