Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10aec3cb authored by George Burgess IV's avatar George Burgess IV
Browse files

metrics: don't crash if `address` is NULL

We check earlier if `address != nullptr` in this function; it stands to
reason that we should have the same check here, as well.

Potential use of null was caught by the static analyzer:
> system/bt/gd/common/metrics.cc:74:9: warning: Called C++ object
pointer is null [clang-analyzer-core.CallAndMessage]

Tag: #security
Bug: 181819141
Test: TreeHugger
Change-Id: I4baf5fe648c8fd841875515b024e1658b7ea20cd
parent ca04d3d1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ void LogMetricLinkLayerConnectionEvent(
        ToHexString(hci_cmd).c_str(),
        ToHexString(hci_event).c_str(),
        ToHexString(hci_ble_event).c_str(),
        address->ToString().c_str(),
        address ? address->ToString().c_str() : "(NULL)",
        connection_handle,
        ToHexString(link_type).c_str(),
        ret);