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

Commit a5d6250b authored by Hansong Zhang's avatar Hansong Zhang Committed by android-build-merger
Browse files

Merge "SMP: Check p_cb->role in smp_br_state_machine_event" into pi-dev

am: 08b442e1

Change-Id: I80fad4c9814f3bed33112a97e7eaf0d63e39ab96
parents 21636f5b 08b442e1
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include "bt_target.h"

#include <string.h>
#include "log/log.h"
#include "smp_int.h"

const char* const smp_br_state_name[SMP_BR_STATE_MAX + 1] = {
@@ -310,6 +311,12 @@ void smp_br_state_machine_event(tSMP_CB* p_cb, tSMP_BR_EVENT event,
    return;
  }

  if (p_cb->role > HCI_ROLE_SLAVE) {
    SMP_TRACE_ERROR("%s: invalid role %d", __func__, p_cb->role);
    android_errorWriteLog(0x534e4554, "80145946");
    return;
  }

  SMP_TRACE_DEBUG("SMP Role: %s State: [%s (%d)], Event: [%s (%d)]",
                  (p_cb->role == HCI_ROLE_SLAVE) ? "Slave" : "Master",
                  smp_get_br_state_name(p_cb->br_state), p_cb->br_state,