From f9ea7a47b12627cf5435f6b3e45462e428bce842 Mon Sep 17 00:00:00 2001 From: xiongweichao Date: Thu, 9 Jan 2025 17:23:17 +0800 Subject: [PATCH] fix(bt/bluedroid): Fixed incorrect types of some variables in SDP --- components/bt/host/bluedroid/api/esp_sdp_api.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/bt/host/bluedroid/api/esp_sdp_api.c b/components/bt/host/bluedroid/api/esp_sdp_api.c index 1cae445260..4c15eedc0b 100644 --- a/components/bt/host/bluedroid/api/esp_sdp_api.c +++ b/components/bt/host/bluedroid/api/esp_sdp_api.c @@ -29,6 +29,18 @@ static bool esp_sdp_record_integrity_check(esp_bluetooth_sdp_record_t *record) ret = false; } break; + case ESP_SDP_TYPE_MAP_MAS: + if ((record->mas.mas_instance_id >> 8) || (record->mas.supported_message_types >> 8)) { + LOG_ERROR("mas_instance_id and supported_message_types are defined as uint8_t in the spec!\n"); + ret = false; + } + break; + case ESP_SDP_TYPE_PBAP_PSE: + if (record->pse.supported_repositories >> 8) { + LOG_ERROR("supported_repositories is defined in the spec as uint8_t!\n"); + ret = false; + } + break; default: if (record->hdr.service_name_length > ESP_SDP_SERVER_NAME_MAX ||