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

Commit b5920731 authored by George Burgess IV's avatar George Burgess IV Committed by Martin Brabham
Browse files

security: fix a potential dereference of nullptr

Clang's static analyzer complained that there's a check for the nullness
of `stored_chan` on line 696, but not a matching one here.

Caught by the static analyzer:
packages/modules/Bluetooth/system/gd/security/internal/security_manager_impl.cc:704:28:
warning: Called C++ object pointer is null
[clang-analyzer-core.CallAndMessage]

Tag: #security
Bug: 206470603
Test: TreeHugger
Change-Id: Ic05b19986164e258464f952a600e610abe70b43c
parent ca7744b8
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -701,7 +701,9 @@ void SecurityManagerImpl::OnPairingFinished(security::PairingResultOrFailure pai
    PairingFailure failure = std::get<PairingFailure>(pairing_result);
    PairingFailure failure = std::get<PairingFailure>(pairing_result);
    LOG_INFO(" ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ failure message: %s",
    LOG_INFO(" ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ failure message: %s",
             failure.message.c_str());
             failure.message.c_str());
    if (stored_chan) {
      NotifyDeviceBondFailed(stored_chan->channel_->GetDevice(), failure);
      NotifyDeviceBondFailed(stored_chan->channel_->GetDevice(), failure);
    }
    return;
    return;
  }
  }