le_meta_ev_dump() print array content without checking index boundary. hcidump would crash if the event index is out-of-boundary --- tools/parser/hci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/parser/hci.c b/tools/parser/hci.c index db7d32c011b9..b434b879a292 100644 --- a/tools/parser/hci.c +++ b/tools/parser/hci.c @@ -3657,7 +3657,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 >= 0 && subevent <= LE_EV_NUM) { + printf("%s\n", ev_le_meta_str[subevent]); + } else { + printf("Undefined--> %d\n", subevent); + } switch (mevt->subevent) { case EVT_LE_CONN_COMPLETE: -- 2.25.1