diff mbox series

[BlueZ] hcidump: fix a crash in le_meta_ev_dump()

Message ID 20200830115948.GA9519@ubuntu
State New
Headers show
Series [BlueZ] hcidump: fix a crash in le_meta_ev_dump() | expand

Commit Message

zefang han Aug. 30, 2020, 11:59 a.m. UTC
---
 tools/parser/hci.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/parser/hci.c b/tools/parser/hci.c
index 41f6fe087..e969d198c 100644
--- a/tools/parser/hci.c
+++ b/tools/parser/hci.c
@@ -3668,7 +3668,12 @@  static inline void le_meta_ev_dump(int level, struct frame *frm)
 	frm->len -= EVT_LE_META_EVENT_SIZE;
 
 	p_indent(level, frm);
-	printf("%s\n", ev_le_meta_str[subevent]);
+
+	if(subevent > LE_EV_NUM){
+		printf("Unknown\n");
+	}else{
+		printf("%s\n", ev_le_meta_str[subevent]);
+	}
 
 	switch (mevt->subevent) {
 	case EVT_LE_CONN_COMPLETE: