mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 17:19:09 -04:00
fix(bt/bluedroid): Fixed incorrect types of some variables in SDP
This commit is contained in:
parent
559bcf1ec9
commit
76da49327e
@ -20,10 +20,27 @@ static bool esp_sdp_record_integrity_check(esp_bluetooth_sdp_record_t *record)
|
|||||||
bool ret = true;
|
bool ret = true;
|
||||||
|
|
||||||
if (record != NULL) {
|
if (record != NULL) {
|
||||||
if (record->hdr.service_name_length > ESP_SDP_SERVER_NAME_MAX ||
|
switch (record->hdr.type) {
|
||||||
strlen(record->hdr.service_name) + 1 != record->hdr.service_name_length) {
|
case ESP_SDP_TYPE_MAP_MAS:
|
||||||
LOG_ERROR("Invalid server name!\n");
|
if ((record->mas.mas_instance_id >> 8) || (record->mas.supported_message_types >> 8)) {
|
||||||
ret = false;
|
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 ||
|
||||||
|
strlen(record->hdr.service_name) + 1 != record->hdr.service_name_length) {
|
||||||
|
LOG_ERROR("Invalid server name!\n");
|
||||||
|
ret = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG_ERROR("record is NULL!\n");
|
LOG_ERROR("record is NULL!\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user