All of lore.kernel.org
 help / color / mirror / Atom feed
From: zefang han <hanzefang@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ] hcidump: fix a crash in le_meta_ev_dump()
Date: Sun, 30 Aug 2020 04:59:48 -0700	[thread overview]
Message-ID: <20200830115948.GA9519@ubuntu> (raw)

---
 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 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:
-- 
2.17.1


             reply	other threads:[~2020-08-30 11:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-30 11:59 zefang han [this message]
2020-08-30 12:24 ` [BlueZ] hcidump: fix a crash in le_meta_ev_dump() bluez.test.bot
2020-08-30 12:24 ` bluez.test.bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200830115948.GA9519@ubuntu \
    --to=hanzefang@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.