All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] hcidump: fix crash for LE meta event
@ 2015-03-12  8:13 chanyeol.park
  2015-03-26  7:19 ` Chanyeol,Park
  0 siblings, 1 reply; 2+ messages in thread
From: chanyeol.park @ 2015-03-12  8:13 UTC (permalink / raw)
  To: linux-bluetooth

From: Chan-yeol Park <chanyeol.park@samsung.com>

This patch fixes the crash when hcidump gets BT 4.1 meta event.
---
 tools/parser/hci.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/tools/parser/hci.c b/tools/parser/hci.c
index 33df542..0918eee 100644
--- a/tools/parser/hci.c
+++ b/tools/parser/hci.c
@@ -127,7 +127,7 @@ static char *event_str[EVENT_NUM + 1] = {
 	"AMP Status Change",
 };
 
-#define LE_EV_NUM 5
+#define LE_EV_NUM 11
 static char *ev_le_meta_str[LE_EV_NUM + 1] = {
 	"Unknown",
 	"LE Connection Complete",
@@ -135,6 +135,12 @@ static char *ev_le_meta_str[LE_EV_NUM + 1] = {
 	"LE Connection Update Complete",
 	"LE Read Remote Used Features Complete",
 	"LE Long Term Key Request",
+	"LE Remote Connection Parameter Request",
+	"LE Data Length Change",
+	"LE Read Local P-256 Public Key Complete",
+	"LE Generate DHKey Complete",
+	"LE Enhanced Connection Complete",
+	"LE Direct Advertising Report",
 };
 
 #define CMD_LINKCTL_NUM 60
@@ -3667,7 +3673,11 @@ 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("%s\n", ev_le_meta_str[subevent]);
+	else
+		printf("%s\n", ev_le_meta_str[0]);
 
 	switch (mevt->subevent) {
 	case EVT_LE_CONN_COMPLETE:
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-26  7:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-12  8:13 [PATCH 1/1] hcidump: fix crash for LE meta event chanyeol.park
2015-03-26  7:19 ` Chanyeol,Park

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.