From 9fd494f730035e19374a2e6e8e81ec9e9e963b2a Mon Sep 17 00:00:00 2001 From: Prasad Alatkar Date: Wed, 9 Sep 2020 12:54:31 +0530 Subject: [PATCH] nimble host: Fix minor bug in ble_eddystone_set_adv_data_gen --- nimble/host/src/ble_eddystone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nimble/host/src/ble_eddystone.c b/nimble/host/src/ble_eddystone.c index 7d80d134d..eccb3e988 100644 --- a/nimble/host/src/ble_eddystone.c +++ b/nimble/host/src/ble_eddystone.c @@ -76,7 +76,7 @@ ble_eddystone_set_adv_data_gen(struct ble_hs_adv_fields *adv_fields, if (adv_fields->num_uuids16 > BLE_EDDYSTONE_MAX_UUIDS16) { return BLE_HS_EINVAL; } - if (svc_data_len > BLE_EDDYSTONE_MAX_SVC_DATA_LEN) { + if (svc_data_len > (BLE_EDDYSTONE_MAX_SVC_DATA_LEN - BLE_EDDYSTONE_SVC_DATA_BASE_SZ)) { return BLE_HS_EINVAL; } if (adv_fields->num_uuids16 > 0 && !adv_fields->uuids16_is_complete) {