summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHansong Zhang <hsz@google.com>2018-05-29 17:38:39 -0700
committerTim Schumacher <timschumi@gmx.de>2018-08-08 21:28:37 +0200
commit56ead56367c8352c6ff90b7f1116a5f57d6f66fa (patch)
treeb697e689db6a09e6a5baf133832a7dbb21ba8e38
parentd393eee00564289065a4a267af60033b5bdf293e (diff)
downloadandroid_system_bt-56ead56367c8352c6ff90b7f1116a5f57d6f66fa.tar.gz
android_system_bt-56ead56367c8352c6ff90b7f1116a5f57d6f66fa.tar.bz2
android_system_bt-56ead56367c8352c6ff90b7f1116a5f57d6f66fa.zip
DO NOT MERGE SMP: Check p_cb->role in smp_br_state_machine_event
Bug: 80145946 Test: manual Change-Id: Ic83eaa4be868d5a345d80cd50a6915c0af719a53 (cherry picked from commit 519b61392a96fbd45bdcc0bfddc881167c20cc23)
-rw-r--r--stack/smp/smp_br_main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/stack/smp/smp_br_main.c b/stack/smp/smp_br_main.c
index ff12d0366..93b4360f7 100644
--- a/stack/smp/smp_br_main.c
+++ b/stack/smp/smp_br_main.c
@@ -19,6 +19,7 @@
#include "bt_target.h"
#include <string.h>
+#include "log/log.h"
#include "smp_int.h"
#if BLE_INCLUDED == TRUE
@@ -344,6 +345,12 @@ void smp_br_state_machine_event(tSMP_CB *p_cb, tSMP_BR_EVENT event, void *p_data
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),