Skip to content
Snippets Groups Projects
Commit 648f7433 authored by Hui Peng's avatar Hui Peng Committed by Android (Google) Code Review
Browse files

Merge "Fix a NPD in sdpu_find_profile_version" into tm-dev

parents ea76b7d9 2de20485
No related branches found
No related tags found
No related merge requests found
......@@ -96,13 +96,18 @@ static std::vector<std::pair<uint16_t, uint16_t>> sdpu_find_profile_version(
uint16_t uuid = p_ssattr->attr_value.v.u16;
// Next attribute should be the version attribute
tSDP_DISC_ATTR* version_attr = p_ssattr->p_next_attr;
if (SDP_DISC_ATTR_TYPE(version_attr->attr_len_type) != UINT_DESC_TYPE ||
if (version_attr == nullptr ||
SDP_DISC_ATTR_TYPE(version_attr->attr_len_type) != UINT_DESC_TYPE ||
SDP_DISC_ATTR_LEN(version_attr->attr_len_type) != 2) {
LOG(WARNING) << __func__ << ": Bad version type "
<< loghex(
SDP_DISC_ATTR_TYPE(version_attr->attr_len_type))
<< ", or length "
<< SDP_DISC_ATTR_LEN(version_attr->attr_len_type);
if (version_attr == nullptr) {
LOG(WARNING) << __func__ << ": version attr not found";
} else {
LOG(WARNING) << __func__ << ": Bad version type "
<< loghex(
SDP_DISC_ATTR_TYPE(version_attr->attr_len_type))
<< ", or length "
<< SDP_DISC_ATTR_LEN(version_attr->attr_len_type);
}
return std::vector<std::pair<uint16_t, uint16_t>>();
}
// High order 8 bits is the major number, low order is the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment