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

Commit c60d59c2 authored by mtk12036's avatar mtk12036 Committed by Paul Wang
Browse files

Fix AVRCP coverity - dereference after null check

[Description]
should check peer_addr null pointer.

Bug: 301369984
Test: atest packages/modules/Bluetooth/system pass

Change-Id: Id63fac93dd2c6d14b488bc1f861907f078230bf8
parent 31390fee
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -344,7 +344,10 @@ void ConnectionHandler::AcceptorControlCb(uint8_t handle, uint8_t event,
  switch (event) {
    case AVRC_OPEN_IND_EVT: {
      LOG(INFO) << __PRETTY_FUNCTION__ << ": Connection Opened Event";
      if (btif_av_src_sink_coexist_enabled() && peer_addr != NULL &&
      if (peer_addr == NULL) {
        return;
      }
      if (btif_av_src_sink_coexist_enabled() &&
          btif_av_peer_is_connected_source(*peer_addr)) {
        LOG(WARNING) << "peer is src, close new avrcp cback";
        if (device_map_.find(handle) != device_map_.end()) {