summaryrefslogtreecommitdiff
path: root/system/stack/sdp/sdp_utils.cc
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2022-07-07 04:50:11 -0700
committerLinux Build Service Account <lnxbuild@localhost>2022-07-07 04:50:11 -0700
commitdd6dc18f57235bf19b3886f51c1c91baa5d62ecc (patch)
tree57eebc6f0878d2d2aa19ccae6ad8332ecbd4c83d /system/stack/sdp/sdp_utils.cc
parent241b2b700fd3cf842291ce13513d6bbb50564560 (diff)
parentc8523f5c9dfc0d3cf2f3ecc3c7f89326733fb276 (diff)
Merge c8523f5c9dfc0d3cf2f3ecc3c7f89326733fb276 on remote branch
Change-Id: Ibd4beb7c71dd436610071aff26ccde92e237dfbd
Diffstat (limited to 'system/stack/sdp/sdp_utils.cc')
-rw-r--r--system/stack/sdp/sdp_utils.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/system/stack/sdp/sdp_utils.cc b/system/stack/sdp/sdp_utils.cc
index 44078ae720..761883e60e 100644
--- a/system/stack/sdp/sdp_utils.cc
+++ b/system/stack/sdp/sdp_utils.cc
@@ -22,6 +22,9 @@
*
******************************************************************************/
+#include <base/logging.h>
+#include <log/log.h>
+
#include <array>
#include <cstdint>
#include <cstring>
@@ -40,8 +43,6 @@
#include "types/bluetooth/uuid.h"
#include "types/raw_address.h"
-#include <base/logging.h>
-
using bluetooth::Uuid;
static const uint8_t sdp_base_uuid[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x00, 0x80, 0x00, 0x00, 0x80,
@@ -126,6 +127,10 @@ static uint16_t sdpu_find_most_specific_service_uuid(tSDP_DISC_REC* p_rec) {
if (p_attr->attr_id == ATTR_ID_SERVICE_CLASS_ID_LIST &&
SDP_DISC_ATTR_TYPE(p_attr->attr_len_type) == DATA_ELE_SEQ_DESC_TYPE) {
tSDP_DISC_ATTR* p_first_attr = p_attr->attr_value.v.p_sub_attr;
+ if (p_first_attr == nullptr) {
+ android_errorWriteLog(0x534e4554, "227203684");
+ return 0;
+ }
if (SDP_DISC_ATTR_TYPE(p_first_attr->attr_len_type) == UUID_DESC_TYPE &&
SDP_DISC_ATTR_LEN(p_first_attr->attr_len_type) == 2) {
return p_first_attr->attr_value.v.u16;
@@ -273,8 +278,9 @@ void sdpu_log_attribute_metrics(const RawAddress& bda,
// [N - native]::SDP::[DIP - Device ID Profile]
ss << "N:SDP::DIP::" << loghex(di_record.rec.vendor_id_source);
log_manufacturer_info(
- bda, android::bluetooth::DeviceInfoSrcEnum::DEVICE_INFO_INTERNAL,
- ss.str(), loghex(di_record.rec.vendor), loghex(di_record.rec.product),
+ bda, android::bluetooth::AddressTypeEnum::ADDRESS_TYPE_PUBLIC,
+ android::bluetooth::DeviceInfoSrcEnum::DEVICE_INFO_INTERNAL, ss.str(),
+ loghex(di_record.rec.vendor), loghex(di_record.rec.product),
loghex(di_record.rec.version), "");
std::string bda_string = bda.ToString();