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

Commit 6b7be1df authored by Myles Watson's avatar Myles Watson
Browse files

RootCanal: Use a copied vector for SetName

Bug: 145638034
Test: ./cert/run_cert_facade_only.sh
Change-Id: Ie0d423a9fa7a8d41d1fa87820d7b83c86f84d536
parent 7638adea
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1080,8 +1080,12 @@ void DualModeController::ReadLocalName(CommandPacketView command) {
void DualModeController::WriteLocalName(CommandPacketView command) {
  auto command_view = gd_hci::WriteLocalNameView::Create(command);
  ASSERT(command_view.IsValid());
  properties_.SetName(std::vector<uint8_t>(command_view.GetLocalName().begin(),
                                           command_view.GetLocalName().end()));
  const auto local_name = command_view.GetLocalName();
  std::vector<uint8_t> name_vec(248);
  for (size_t i = 0; i < 248; i++) {
    name_vec[i] = local_name[i];
  }
  properties_.SetName(name_vec);
  auto packet = bluetooth::hci::WriteLocalNameCompleteBuilder::Create(
      kNumCommandPackets, ErrorCode::SUCCESS);
  send_event_(std::move(packet));